diff --git a/Stone.WinForm/Stone.WinBiz/BasicData/F_ErrTypeLevel.cs b/Stone.WinForm/Stone.WinBiz/BasicData/F_ErrTypeLevel.cs index d4f3c14..639a882 100644 --- a/Stone.WinForm/Stone.WinBiz/BasicData/F_ErrTypeLevel.cs +++ b/Stone.WinForm/Stone.WinBiz/BasicData/F_ErrTypeLevel.cs @@ -15,9 +15,8 @@ namespace Stone.WinBiz.BasicData public F_ErrTypeLevel() { this.type = "ErrTypeLevel"; - this.name = "系统设置_预期设置"; + this.name = "系统设置_预警设置"; this.entity = new Entity_t_ErrTypeLevel(); - //this.entityView = new Entity_v_Product(); } public override void GetView(DataGridView dgv) @@ -33,61 +32,33 @@ namespace Stone.WinBiz.BasicData public override void Checking(DataRow drData, bool isNew) { - //base.Checking(drData, isNew); - - - //if ((new F_CarModel()).GetData("Code='" + drData["CarModelCode"].ToString() + "'") == null) - // throw new Exception("车型代码 " + drData["CarModelCode"].ToString() + " 不存在!"); - - //if ((new F_Color()).GetData("Code='" + drData["ColorCode"].ToString() + "'") == null) - // throw new Exception("颜色代码 " + drData["ColorCode"].ToString() + " 不存在!"); - - - //if (MyStrings.GetLength(drData["Name"].ToString()) > 255) throw new Exception("名称不能超过255个字符!"); + base.Checking(drData, isNew); } public override void InputData(DataSet dsData, LocalDBService db) { - //Entity_t_Product t_Input = new Entity_t_Product(db); - //DataRow drInput = null; - - //foreach (DataRow drData in dsData.Tables[0].Rows) - //{ - - // drInput = t_Input.Table.NewRow(); - // drInput["Code"] = drData["存货代码"].ToString().Trim(); - // drInput["Name"] = drData["存货名称"].ToString().Trim(); - // drInput["CarModelCode"] = drData["车型代码"].ToString().Trim(); - // drInput["ColorCode"] = drData["颜色代码"].ToString().Trim(); - // drInput["Model"] = drData["规格型号"].ToString().Trim(); - // drInput["Deploy"] = drData["配置"].ToString().Trim(); - // drInput["BarCode"] = drData["条码号"].ToString(); - // drInput["PackNumer"] = drData["装箱数量"].ToString(); - // drInput["IsStandard"] = drData["是否STD件"].ToString(); - // drInput["State"] = drData["启用"].ToString(); - - // if (drInput["Code"].ToString().Trim() == "") - // throw new Exception("代码不能为空!"); - - - // if (t_Input.GetData("", "Code='" + drInput["Code"].ToString() + "'", "id asc").Tables[0].Rows.Count > 0) - // throw new Exception("代码 " + drInput["Code"].ToString() + " 已经存在!"); - + Entity_t_ErrTypeLevel t_Input = new Entity_t_ErrTypeLevel(db); + DataRow drInput = null; - // if ((new Entity_t_CarModel(db)).GetData("", "Code='" + drInput["CarModelCode"].ToString() + "'", "id asc").Tables[0].Rows.Count == 0) - // throw new Exception("车型代码 " + drInput["CarModelCode"].ToString() + " 不存在!"); + foreach (DataRow drData in dsData.Tables[0].Rows) + { - // if ((new Entity_t_Color(db)).GetData("", "Code='" + drInput["ColorCode"].ToString() + "'", "id asc").Tables[0].Rows.Count == 0) - // throw new Exception("颜色代码 " + drInput["ColorCode"].ToString() + " 不存在!"); + drInput = t_Input.Table.NewRow(); + drInput["Code"] = drData["类型编码"].ToString().Trim(); + drInput["ErrTypeDesc"] = drData["类型描述"].ToString().Trim(); + drInput["ErrLevel"] = drData["级别"].ToString().Trim(); + drInput["ToPerson"] = drData["邮件通知人"].ToString().Trim(); + if (drInput["Code"].ToString().Trim() == "") + throw new Exception("代码不能为空!"); - // if (MyStrings.GetLength(drInput["Name"].ToString()) > 255) throw new Exception("名称不能超过255个字符!"); - // //Checking(drInput, true); - // t_Input.Add(drInput); + if (t_Input.GetData("", "Code='" + drInput["Code"].ToString() + "'", "id asc").Tables[0].Rows.Count > 0) + throw new Exception("类型编码 " + drInput["Code"].ToString() + " 已经存在!"); + t_Input.Add(drInput); - //} + } } } } diff --git a/Stone.WinForm/Stone.WinBiz/BasicData/F_PartOutQty.cs b/Stone.WinForm/Stone.WinBiz/BasicData/F_PartOutQty.cs index abbb7c6..32e1728 100644 --- a/Stone.WinForm/Stone.WinBiz/BasicData/F_PartOutQty.cs +++ b/Stone.WinForm/Stone.WinBiz/BasicData/F_PartOutQty.cs @@ -17,7 +17,6 @@ namespace Stone.WinBiz.BasicData this.type = "PartOutQty"; this.name = "基础资料_累计发货数量"; this.entity = new Entity_t_PartOutQty(); - //this.entityView = new Entity_v_Product(); } public override void GetView(DataGridView dgv) @@ -32,61 +31,32 @@ namespace Stone.WinBiz.BasicData public override void Checking(DataRow drData, bool isNew) { - //base.Checking(drData, isNew); - - - //if ((new F_CarModel()).GetData("Code='" + drData["CarModelCode"].ToString() + "'") == null) - // throw new Exception("车型代码 " + drData["CarModelCode"].ToString() + " 不存在!"); - - //if ((new F_Color()).GetData("Code='" + drData["ColorCode"].ToString() + "'") == null) - // throw new Exception("颜色代码 " + drData["ColorCode"].ToString() + " 不存在!"); - - - //if (MyStrings.GetLength(drData["Name"].ToString()) > 255) throw new Exception("名称不能超过255个字符!"); + base.Checking(drData, isNew); } public override void InputData(DataSet dsData, LocalDBService db) { - //Entity_t_Product t_Input = new Entity_t_Product(db); - //DataRow drInput = null; - - //foreach (DataRow drData in dsData.Tables[0].Rows) - //{ - - // drInput = t_Input.Table.NewRow(); - // drInput["Code"] = drData["存货代码"].ToString().Trim(); - // drInput["Name"] = drData["存货名称"].ToString().Trim(); - // drInput["CarModelCode"] = drData["车型代码"].ToString().Trim(); - // drInput["ColorCode"] = drData["颜色代码"].ToString().Trim(); - // drInput["Model"] = drData["规格型号"].ToString().Trim(); - // drInput["Deploy"] = drData["配置"].ToString().Trim(); - // drInput["BarCode"] = drData["条码号"].ToString(); - // drInput["PackNumer"] = drData["装箱数量"].ToString(); - // drInput["IsStandard"] = drData["是否STD件"].ToString(); - // drInput["State"] = drData["启用"].ToString(); - - // if (drInput["Code"].ToString().Trim() == "") - // throw new Exception("代码不能为空!"); - - - // if (t_Input.GetData("", "Code='" + drInput["Code"].ToString() + "'", "id asc").Tables[0].Rows.Count > 0) - // throw new Exception("代码 " + drInput["Code"].ToString() + " 已经存在!"); - + Entity_t_PartOutQty t_Input = new Entity_t_PartOutQty(db); + DataRow drInput = null; - // if ((new Entity_t_CarModel(db)).GetData("", "Code='" + drInput["CarModelCode"].ToString() + "'", "id asc").Tables[0].Rows.Count == 0) - // throw new Exception("车型代码 " + drInput["CarModelCode"].ToString() + " 不存在!"); + foreach (DataRow drData in dsData.Tables[0].Rows) + { - // if ((new Entity_t_Color(db)).GetData("", "Code='" + drInput["ColorCode"].ToString() + "'", "id asc").Tables[0].Rows.Count == 0) - // throw new Exception("颜色代码 " + drInput["ColorCode"].ToString() + " 不存在!"); + drInput = t_Input.Table.NewRow(); + drInput["Code"] = drData["存货代码"].ToString().Trim(); + drInput["PartOutQty"] = drData["累计发货数量"].ToString().Trim(); + + if (drInput["Code"].ToString().Trim() == "") + throw new Exception("存货代码不能为空!"); - // if (MyStrings.GetLength(drInput["Name"].ToString()) > 255) throw new Exception("名称不能超过255个字符!"); - // //Checking(drInput, true); - // t_Input.Add(drInput); + if (t_Input.GetData("", "Code='" + drInput["Code"].ToString() + "'", "id asc").Tables[0].Rows.Count > 0) + throw new Exception("存货代码 " + drInput["Code"].ToString() + " 已经存在!"); + t_Input.Add(drInput); - //} + } } } } diff --git a/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs b/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs index 44a3015..3316c02 100644 --- a/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs +++ b/Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs @@ -141,12 +141,12 @@ namespace Stone.WinBiz.JISAdmin { //获取收件人 var mailTo = dsErrMail.Tables[0].Rows[0]["ToPerson"].ToString(); - var errLvevl = dsErrMail.Tables[0].Rows[0]["ErrLvevl"].ToString(); + var errLvevl = dsErrMail.Tables[0].Rows[0]["ErrLevel"].ToString(); var errTypeDesc = dsErrMail.Tables[0].Rows[0]["ErrTypeDesc"].ToString(); //设置邮件标题 var title = ""; - title = "LAB解析异常:错误级别-" + errLvevl + " " + errTypeDesc; - F_Mail.Send(file.Name + " 处理失败,未能成功解析!", title, mailTo); + title = "LAB解析异常:错误级别-" + errLvevl + "-" + errTypeDesc; + F_Mail.Send(file.Name + "解析失败", title, mailTo); } // F_Mail.Send(file.Name + " 处理失败,原因为:" + ex.Message); @@ -325,7 +325,7 @@ namespace Stone.WinBiz.JISAdmin } else { - strPartMsg += "卸货点 " + location + " 未在系统中定义效!" + Environment.NewLine; + strPartMsg += "卸货点 " + location + " 未在系统中定义!" + Environment.NewLine; if (errType == 0 || errType > 2) { errType = 2; @@ -341,7 +341,7 @@ namespace Stone.WinBiz.JISAdmin dsLoc = db.Exec_DataSet(strsql); if (dsLoc.Tables[0].Rows.Count == 0) { - strPartMsg += "卸货点 " + location + " 对应的代码 " + LocationCode + " 未在系统中定义效!" + Environment.NewLine; + strPartMsg += "卸货点 " + location + " 对应的代码 " + LocationCode + " 未在系统中定义!" + Environment.NewLine; if (errType == 0 || errType > 3) { errType = 3; @@ -436,12 +436,12 @@ namespace Stone.WinBiz.JISAdmin { //获取收件人 var mailTo = dsErrMail.Tables[0].Rows[0]["ToPerson"].ToString(); - var errLvevl = dsErrMail.Tables[0].Rows[0]["ErrLvevl"].ToString(); + var errLvevl = dsErrMail.Tables[0].Rows[0]["ErrLevel"].ToString(); var errTypeDesc = dsErrMail.Tables[0].Rows[0]["ErrTypeDesc"].ToString(); //设置邮件标题 var title = ""; - title = "LAB解析异常:错误级别-" + errLvevl + " " + errTypeDesc; - F_Mail.Send(strPartMsg,title, mailTo); + title = "LAB解析异常-错误级别-" + errLvevl + "-" + errTypeDesc; + F_Mail.Send(title, strPartMsg, mailTo); } } diff --git a/Stone.WinForm/Stone.WinModule/BasicData/F_Factory.cs b/Stone.WinForm/Stone.WinModule/BasicData/F_Factory.cs index 2a923c5..0f11856 100644 --- a/Stone.WinForm/Stone.WinModule/BasicData/F_Factory.cs +++ b/Stone.WinForm/Stone.WinModule/BasicData/F_Factory.cs @@ -95,7 +95,14 @@ namespace Stone.WinModule.BasicData frm.m_Base = f_base; return frm; } - + + if (f_base.type == "PartOutQty") + { + frmPartOutQtyDetail frm = new frmPartOutQtyDetail(); + frm.m_Base = f_base; + return frm; + } + return null; } diff --git a/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.Designer.cs b/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.Designer.cs index af4eb92..39bd4d0 100644 --- a/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.Designer.cs +++ b/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.Designer.cs @@ -28,7 +28,7 @@ /// private void InitializeComponent() { - this.txtMemo = new System.Windows.Forms.TextBox(); + this.txtLevel = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.txtName = new System.Windows.Forms.TextBox(); this.txtCode = new System.Windows.Forms.TextBox(); @@ -41,96 +41,108 @@ // // btnAddNewLine // - this.btnAddNewLine.Location = new System.Drawing.Point(41, 191); + this.btnAddNewLine.Location = new System.Drawing.Point(62, 286); + this.btnAddNewLine.Margin = new System.Windows.Forms.Padding(6); // // btnClose // - this.btnClose.Location = new System.Drawing.Point(254, 191); + this.btnClose.Location = new System.Drawing.Point(381, 286); + this.btnClose.Margin = new System.Windows.Forms.Padding(6); // // btnOK // - this.btnOK.Location = new System.Drawing.Point(167, 191); + this.btnOK.Location = new System.Drawing.Point(250, 286); + this.btnOK.Margin = new System.Windows.Forms.Padding(6); // - // txtMemo + // txtLevel // - this.txtMemo.Location = new System.Drawing.Point(113, 100); - this.txtMemo.MaxLength = 200; - this.txtMemo.Name = "txtMemo"; - this.txtMemo.Size = new System.Drawing.Size(222, 21); - this.txtMemo.TabIndex = 2; + this.txtLevel.Location = new System.Drawing.Point(170, 150); + this.txtLevel.Margin = new System.Windows.Forms.Padding(4); + this.txtLevel.MaxLength = 200; + this.txtLevel.Name = "txtLevel"; + this.txtLevel.Size = new System.Drawing.Size(331, 28); + this.txtLevel.TabIndex = 2; // // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(23, 103); + this.label3.Location = new System.Drawing.Point(34, 154); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(41, 12); + this.label3.Size = new System.Drawing.Size(62, 18); this.label3.TabIndex = 111; this.label3.Text = "级别:"; // // txtName // - this.txtName.Location = new System.Drawing.Point(113, 71); + this.txtName.Location = new System.Drawing.Point(170, 106); + this.txtName.Margin = new System.Windows.Forms.Padding(4); this.txtName.MaxLength = 100; this.txtName.Name = "txtName"; - this.txtName.Size = new System.Drawing.Size(222, 21); + this.txtName.Size = new System.Drawing.Size(331, 28); this.txtName.TabIndex = 1; // // txtCode // - this.txtCode.Location = new System.Drawing.Point(113, 40); + this.txtCode.Location = new System.Drawing.Point(170, 60); + this.txtCode.Margin = new System.Windows.Forms.Padding(4); this.txtCode.MaxLength = 10; this.txtCode.Name = "txtCode"; - this.txtCode.Size = new System.Drawing.Size(222, 21); + this.txtCode.Size = new System.Drawing.Size(331, 28); this.txtCode.TabIndex = 0; // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(23, 74); + this.label2.Location = new System.Drawing.Point(34, 111); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(65, 12); + this.label2.Size = new System.Drawing.Size(98, 18); this.label2.TabIndex = 109; this.label2.Text = "预警类型:"; // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(23, 44); + this.label1.Location = new System.Drawing.Point(34, 66); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(65, 12); + this.label1.Size = new System.Drawing.Size(98, 18); this.label1.TabIndex = 108; this.label1.Text = "类型编码:"; // // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(23, 140); + this.label4.Location = new System.Drawing.Point(34, 201); + this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(77, 12); + this.label4.Size = new System.Drawing.Size(116, 18); this.label4.TabIndex = 111; this.label4.Text = "邮件通知人:"; // // txtemail // - this.txtemail.Location = new System.Drawing.Point(113, 137); + this.txtemail.Location = new System.Drawing.Point(170, 197); + this.txtemail.Margin = new System.Windows.Forms.Padding(4); this.txtemail.MaxLength = 200; this.txtemail.Name = "txtemail"; - this.txtemail.Size = new System.Drawing.Size(222, 21); + this.txtemail.Size = new System.Drawing.Size(331, 28); this.txtemail.TabIndex = 2; // // frmErrTypeLevelDetail // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); - this.ClientSize = new System.Drawing.Size(381, 277); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); + this.ClientSize = new System.Drawing.Size(572, 416); this.Controls.Add(this.txtemail); - this.Controls.Add(this.txtMemo); + this.Controls.Add(this.txtLevel); this.Controls.Add(this.label4); this.Controls.Add(this.label3); this.Controls.Add(this.txtName); this.Controls.Add(this.txtCode); this.Controls.Add(this.label2); this.Controls.Add(this.label1); + this.Margin = new System.Windows.Forms.Padding(6); this.Name = "frmErrTypeLevelDetail"; this.Load += new System.EventHandler(this.frmColorDetail_Load); this.Controls.SetChildIndex(this.btnOK, 0); @@ -142,7 +154,7 @@ this.Controls.SetChildIndex(this.txtName, 0); this.Controls.SetChildIndex(this.label3, 0); this.Controls.SetChildIndex(this.label4, 0); - this.Controls.SetChildIndex(this.txtMemo, 0); + this.Controls.SetChildIndex(this.txtLevel, 0); this.Controls.SetChildIndex(this.txtemail, 0); this.ResumeLayout(false); this.PerformLayout(); @@ -151,7 +163,7 @@ #endregion - private System.Windows.Forms.TextBox txtMemo; + private System.Windows.Forms.TextBox txtLevel; private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox txtName; private System.Windows.Forms.TextBox txtCode; diff --git a/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.cs b/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.cs index cf8ab63..438caec 100644 --- a/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.cs +++ b/Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.cs @@ -25,12 +25,12 @@ namespace Stone.WinModule.BasicData { if (!MyValidator.IsEmpty(this.txtCode, "")) return false; if (!MyValidator.IsEmpty(this.txtName, "")) return false; - if (!MyValidator.IsEmpty(this.txtMemo, "")) return false; + if (!MyValidator.IsEmpty(this.txtLevel, "")) return false; if (!MyValidator.IsEmpty(this.txtemail, "")) return false; base.GetData(); drData["Code"] = MyStrings.GetString(this.txtCode.Text.Trim()); drData["ErrTypeDesc"] = MyStrings.GetString(this.txtName.Text.Trim()); - drData["Errlevel"] = MyStrings.GetString(this.txtMemo.Text.Trim()); + drData["Errlevel"] = MyStrings.GetString(this.txtLevel.Text.Trim()); drData["ToPerson"] = MyStrings.GetString(this.txtemail.Text.Trim()); return true; @@ -46,8 +46,9 @@ namespace Stone.WinModule.BasicData if (base.SetData()) { this.txtCode.Text = drData["Code"].ToString(); - this.txtName.Text = drData["Name"].ToString(); - this.txtMemo.Text = drData["Memo"].ToString(); + this.txtName.Text = drData["ErrTypeDesc"].ToString(); + this.txtLevel.Text = drData["ErrLevel"].ToString(); + this.txtemail.Text = drData["ToPerson"].ToString(); } return false; @@ -58,7 +59,8 @@ namespace Stone.WinModule.BasicData base.Clear(); this.txtCode.Text = ""; this.txtName.Text = ""; - this.txtMemo.Text = ""; + this.txtLevel.Text = ""; + this.txtemail.Text = ""; this.txtCode.Focus(); } diff --git a/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.Designer.cs b/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.Designer.cs new file mode 100644 index 0000000..b89c973 --- /dev/null +++ b/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.Designer.cs @@ -0,0 +1,121 @@ +namespace Stone.WinModule.BasicData +{ + partial class frmPartOutQtyDetail + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.txtOutQty = new System.Windows.Forms.TextBox(); + this.txtCode = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.colorDialog1 = new System.Windows.Forms.ColorDialog(); + this.SuspendLayout(); + // + // btnAddNewLine + // + this.btnAddNewLine.Location = new System.Drawing.Point(60, 190); + this.btnAddNewLine.Margin = new System.Windows.Forms.Padding(6); + // + // btnClose + // + this.btnClose.Location = new System.Drawing.Point(379, 190); + this.btnClose.Margin = new System.Windows.Forms.Padding(6); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point(248, 190); + this.btnOK.Margin = new System.Windows.Forms.Padding(6); + // + // txtOutQty + // + this.txtOutQty.Location = new System.Drawing.Point(170, 106); + this.txtOutQty.Margin = new System.Windows.Forms.Padding(4); + this.txtOutQty.MaxLength = 100; + this.txtOutQty.Name = "txtOutQty"; + this.txtOutQty.Size = new System.Drawing.Size(331, 28); + this.txtOutQty.TabIndex = 1; + // + // txtCode + // + this.txtCode.Location = new System.Drawing.Point(170, 60); + this.txtCode.Margin = new System.Windows.Forms.Padding(4); + this.txtCode.MaxLength = 10; + this.txtCode.Name = "txtCode"; + this.txtCode.Size = new System.Drawing.Size(331, 28); + this.txtCode.TabIndex = 0; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(34, 111); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(134, 18); + this.label2.TabIndex = 109; + this.label2.Text = "累计发货数量:"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(34, 66); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(80, 18); + this.label1.TabIndex = 108; + this.label1.Text = "物料号:"; + // + // frmPartOutQtyDetail + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); + this.ClientSize = new System.Drawing.Size(572, 288); + this.Controls.Add(this.txtOutQty); + this.Controls.Add(this.txtCode); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Margin = new System.Windows.Forms.Padding(6); + this.Name = "frmPartOutQtyDetail"; + this.Load += new System.EventHandler(this.frmColorDetail_Load); + this.Controls.SetChildIndex(this.btnOK, 0); + this.Controls.SetChildIndex(this.btnClose, 0); + this.Controls.SetChildIndex(this.btnAddNewLine, 0); + this.Controls.SetChildIndex(this.label1, 0); + this.Controls.SetChildIndex(this.label2, 0); + this.Controls.SetChildIndex(this.txtCode, 0); + this.Controls.SetChildIndex(this.txtOutQty, 0); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.TextBox txtOutQty; + private System.Windows.Forms.TextBox txtCode; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ColorDialog colorDialog1; + } +} diff --git a/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.cs b/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.cs new file mode 100644 index 0000000..602c594 --- /dev/null +++ b/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using Stone.Common; + +namespace Stone.WinModule.BasicData +{ + public partial class frmPartOutQtyDetail : Stone.WinModule.BasicData.frmBaseMainDetail + { + public frmPartOutQtyDetail() + { + InitializeComponent(); + } + + private void frmColorDetail_Load(object sender, EventArgs e) + { + + } + + public override bool GetData() + { + if (!MyValidator.IsEmpty(this.txtCode, "")) return false; + if (!MyValidator.IsEmpty(this.txtOutQty, "")) return false; + base.GetData(); + drData["Code"] = MyStrings.GetString(this.txtCode.Text.Trim()); + drData["PartOutQty"] = MyStrings.GetString(this.txtOutQty.Text.Trim()); + + return true; + } + + public override bool SetData() + { + if (type == 2) + { + this.txtCode.ReadOnly = true; + } + + if (base.SetData()) + { + this.txtCode.Text = drData["Code"].ToString(); + this.txtOutQty.Text = drData["PartOutQty"].ToString(); + } + + return false; + } + + public override void Clear() + { + base.Clear(); + this.txtCode.Text = ""; + this.txtOutQty.Text = ""; + this.txtCode.Focus(); + } + + } +} diff --git a/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.resx b/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.resx new file mode 100644 index 0000000..aa0ca0f --- /dev/null +++ b/Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs index cc89fe7..9aa7f43 100644 --- a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs +++ b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs @@ -323,10 +323,10 @@ namespace Stone.WinModule.Standard string Date = MyDateTime.GetServerDateTime().ToString("yyyy-MM-dd"); string AsnNumbers = ""; - List lsPartOutQty = new List(); - - var lstSql = new List(); var strsql = ""; + var dtPartOutQty = new DataTable(); + strsql = "select * from t_PartOutQty"; + dtPartOutQty = db.Exec_DataSet(strsql).Tables[0]; foreach (DataRow drData in dtData.Rows) { @@ -393,11 +393,14 @@ namespace Stone.WinModule.Standard t_JIS_VDA.Add(drVDA); //增加已发货数量 - - strsql = "Update t_PartOutQty" + - " set PartOutQty += " + decimal.Parse(drData["PackNumer"].ToString()) + "" + - " where Code = '" + drData["PartNumber"].ToString() + "'"; - db.Exec_NonQuery(strsql); + var code = drData["PartNumber"].ToString(); + var outQty = decimal.Parse(drData["PackNumer"].ToString()); + strsql = CreatePartOutSql(code, outQty, dtPartOutQty,out dtPartOutQty); + if (!string.IsNullOrEmpty(strsql)) + { + db.Exec_NonQuery(strsql); + } + PackageNos += drVDA["PackageNo"].ToString() + ","; } @@ -418,10 +421,14 @@ namespace Stone.WinModule.Standard t_JIS_VDA.Add(drVDA); //增加已发货数量 - strsql = "Update t_PartOutQty" + - " set PartOutQty += " + Odd + "" + - " where Code = '" + drData["PartNumber"].ToString() + "'"; - db.Exec_NonQuery(strsql); + var code = drData["PartNumber"].ToString(); + var outQty = Odd; + strsql = CreatePartOutSql(code, outQty, dtPartOutQty, out dtPartOutQty); + if (!string.IsNullOrEmpty(strsql)) + { + db.Exec_NonQuery(strsql); + } + PackageNos += drVDA["PackageNo"].ToString() + ","; } @@ -444,6 +451,30 @@ namespace Stone.WinModule.Standard } + private static string CreatePartOutSql(string PartCode,decimal outQty,DataTable dt, out DataTable dtPartOutQty) + { + dtPartOutQty = dt; + string strsql = ""; + if (dtPartOutQty.Select(" Code = '" + PartCode + "'").Length > 0) + { + strsql = "Update t_PartOutQty" + + " set PartOutQty += " + outQty + "" + + " where Code = '" + PartCode + "'"; + } + else + { + strsql = "Insert into t_PartOutQty(Code,PartOutQty) values ('" + PartCode + "'," + outQty + ")"; + var db = new LocalDBService(); + db.Exec_NonQuery(strsql); + //DT重新赋值 + strsql = "select * from t_PartOutQty"; + dtPartOutQty = db.Exec_DataSet(strsql).Tables[0]; + strsql = ""; + } + + return strsql; + } + private void timer2_Tick(object sender, EventArgs e) { this.timer2.Enabled = false; diff --git a/Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj b/Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj index a30a6a0..2772dfc 100644 --- a/Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj +++ b/Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj @@ -154,6 +154,12 @@ frmCallOff.cs + + Form + + + frmPartOutQtyDetail.cs + Form @@ -652,6 +658,9 @@ frmColor.cs + + frmPartOutQtyDetail.cs + frmErrTypeLevelDetail.cs