using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Text;
|
using System.Windows.Forms;
|
|
namespace SCM
|
{
|
public partial class WMS_CLDUploadExceptionQuery : Form
|
{
|
public WMS_CLDUploadExceptionQuery()
|
{
|
InitializeComponent();
|
}
|
public frmBillQueryCondition_Base frmCondition;
|
const string ModCaption = "CLOUD提交失败异常查询";
|
Pub_Class.ClsGridListSum oSumGrid = new Pub_Class.ClsGridListSum();
|
public Int32 iTopRow = 0;//画横线
|
SCM.WMSWeb.WebService1 oWeb = new SCM.WMSWeb.WebService1();
|
//
|
|
#region 固定代码
|
|
//清空界面
|
public void Sub_ClearBill()
|
{
|
cmbHBillType.Items.Clear();
|
cmbHSourceBillType.Items.Clear();
|
//
|
cmbHBillType.Items.Add("产品入库单");
|
cmbHBillType.Items.Add("外购入库单");
|
cmbHBillType.Items.Add("其他入库单");
|
cmbHBillType.Items.Add("领料出库单");
|
cmbHBillType.Items.Add("销售出库单");
|
cmbHBillType.Items.Add("其他出库单");
|
cmbHBillType.Items.Add("委外出库单");
|
cmbHBillType.Items.Add("直接调拨单");
|
cmbHBillType.Items.Add("分步式调出单");
|
cmbHBillType.Items.Add("分步式调入单");
|
cmbHBillType.Items.Add("生产汇报单");
|
cmbHBillType.Items.Add("外购退料单");
|
cmbHBillType.Items.Add("销售退库单");
|
cmbHBillType.SelectedIndex = 0;
|
//
|
txtHInterID.Text = "";
|
txtHBillNo.Text = "";
|
initGrid();
|
}
|
|
private void WMS_CLDUploadExceptionQuery_Load(object sender, EventArgs e)
|
{
|
//设置动态URL
|
oWeb.Url = SCM.ClsPub1.WEBSURL;
|
//
|
frmCondition = new frmBillQueryCondition_Base();
|
this.Text = ModCaption;
|
lblCaption.Text = ModCaption;
|
oSumGrid.ogrdMain = grdSub; //初始化 new
|
oSumGrid.oGridsum = grdSum;
|
initGrid();
|
cmbHBillType.SelectedIndex = 0;
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
|
//初始化网格
|
private void initGrid()
|
{
|
ClsPub1.initGridList(grdMain, this.Name);
|
ClsPub1.initGridList(grdSub, this.Name + "grdSub");
|
//DBUtility.Xt_BaseBillFun.initGridList(grdMain, this.Name);
|
//DBUtility.Xt_BaseBillFun.initGridList(grdSub, this.Name + "grdSub");
|
}
|
|
//时间控件
|
private void timer1_Tick(object sender, EventArgs e)
|
{
|
timer1.Enabled=false;
|
Sub_ClearBill();
|
}
|
|
private void timer2_Tick(object sender, EventArgs e)
|
{
|
timer2.Enabled = false;
|
}
|
|
//退出
|
private void tc_Click(object sender, EventArgs e)
|
{
|
this.Close();
|
}
|
|
private void grdMain_Paint(object sender, PaintEventArgs e)
|
{
|
GraphicsGrid();
|
}
|
|
private void GraphicsGrid()
|
{
|
//画底线
|
DBUtility.Xt_BaseBillFun.GraphicsGrid(grdMain);
|
//画横线
|
DBUtility.Xt_BaseBillFun.GraphicsRowGrid(grdMain, iTopRow, iTopRow + 50, Fun_GetCol("hmainid"));
|
}
|
|
private Int32 Fun_GetCol(string sCol)
|
{
|
return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain);
|
}
|
|
//保存列宽
|
private void bclk_Click(object sender, EventArgs e)
|
{
|
DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
|
DBUtility.Xt_BaseBillFun.SaveGrid(grdSub, this.Name + "grdSub");
|
}
|
|
//默认列宽
|
private void mrlk_Click(object sender, EventArgs e)
|
{
|
DBUtility.Xt_BaseBillFun.DefaultGridView(grdMain, this.Name);
|
DBUtility.Xt_BaseBillFun.DefaultGridView(grdSub, this.Name + "grdSub");
|
}
|
|
#endregion
|
|
|
#region 选择单据类型
|
|
//选择单据类型
|
private void cmbHBillType_TextChanged(object sender, EventArgs e)
|
{
|
cmbHSourceBillType.Items.Clear();
|
|
if (cmbHBillType.Text == "产品入库单")
|
{
|
cmbHSourceBillType.Items.Add("生产订单");
|
cmbHSourceBillType.Items.Add("生产汇报单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "外购入库单")
|
{
|
cmbHSourceBillType.Items.Add("采购订单");
|
cmbHSourceBillType.Items.Add("收料通知单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "其他入库单")
|
{
|
cmbHSourceBillType.Items.Add("无源单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "领料出库单")
|
{
|
cmbHSourceBillType.Items.Add("生产用料清单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "销售出库单")
|
{
|
cmbHSourceBillType.Items.Add("销售订单");
|
cmbHSourceBillType.Items.Add("发货通知单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "其他出库单")
|
{
|
cmbHSourceBillType.Items.Add("无源单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "委外出库单")
|
{
|
cmbHSourceBillType.Items.Add("委外用料清单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "直接调拨单")
|
{
|
cmbHSourceBillType.Items.Add("发货通知单");
|
cmbHSourceBillType.Items.Add("生产用料清单");
|
cmbHSourceBillType.Items.Add("无源单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "分步式调出单")
|
{
|
cmbHSourceBillType.Items.Add("发货通知单");
|
cmbHSourceBillType.Items.Add("无源单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "分步式调入单")
|
{
|
cmbHSourceBillType.Items.Add("分步式调出单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "生产汇报单")
|
{
|
cmbHSourceBillType.Items.Add("生产订单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "外购退料单")
|
{
|
cmbHSourceBillType.Items.Add("采购订单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else if (cmbHBillType.Text == "销售退库单")
|
{
|
cmbHSourceBillType.Items.Add("退货通知单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
else
|
{
|
cmbHSourceBillType.Items.Add("无源单");
|
cmbHSourceBillType.SelectedIndex = 0;
|
}
|
}
|
|
#endregion
|
|
|
#region 查询方法
|
|
//查询按钮
|
private void btnOK_Click(object sender, EventArgs e)
|
{
|
Sub_FastQuery();
|
}
|
|
private void Sub_FastQuery()
|
{
|
Int64 HInterID = 0; //单据内码
|
string HBillNo = ""; //单据号
|
string HBillType = ""; //单据类型
|
string HSourceBillType = ""; //源单类型
|
|
HInterID = DBUtility.ClsPub.isLong(txtHInterID.Text);
|
HBillNo = txtHBillNo.Text.Trim();
|
HBillType = cmbHBillType.Text;
|
HSourceBillType = cmbHSourceBillType.Text;
|
|
if (HInterID == 0)
|
{
|
MessageBox.Show("单据内码不能为空!");
|
return;
|
}
|
else if (HBillNo == "")
|
{
|
MessageBox.Show("单据号不能为空!");
|
return;
|
}
|
|
DataSet DS = oWeb.getDataSetBySQL("exec h_p_WMS_CLDUploadException '" + HBillType + "','" + HSourceBillType + "','" + HBillNo + "'," + HInterID, "h_p_WMS_CLDUploadException", ref DBUtility.ClsPub.sExeReturnInfo);
|
//
|
if (DS == null)
|
{
|
MessageBox.Show("没有找到所选单据类型对应的源单类型调用方法!");
|
return;
|
}
|
else
|
{
|
Display(DS.Tables[0]);
|
DisplayEntry(DS.Tables[1]);
|
}
|
}
|
|
//显示
|
private void Display(DataTable oTable)
|
{
|
//释放冻结
|
DBUtility.Xt_BaseBillFun.CancelFrozenCol(grdMain);
|
//绑定
|
grdMain.DataSource = oTable.DefaultView;
|
//冻结
|
int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text);
|
string s = frmCondition.cmbHComplete.Text;
|
DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s, FrCol);
|
}
|
|
//显示明细
|
private void DisplayEntry(DataTable oTable)
|
{
|
//释放冻结
|
DBUtility.Xt_BaseBillFun.CancelFrozenCol(grdSub);
|
//绑定
|
grdSub.DataSource = oTable.DefaultView;
|
//冻结
|
int FrCol = 1;
|
string s = frmCondition.cmbHComplete.Text;
|
DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name + "grdSub", s, FrCol);
|
}
|
|
#endregion
|
|
|
|
|
}
|
}
|