Browse Source

1.预警邮件编辑功能

2.累计发货数量基础数据
3.LAB解析邮件预警
4.生成VDA时计算累计发货数量逻辑优化,识别到 未维护的零件时,增加记录
master
hao.jin 3 years ago
parent
commit
b37f23ccab
  1. 63
      Stone.WinForm/Stone.WinBiz/BasicData/F_ErrTypeLevel.cs
  2. 60
      Stone.WinForm/Stone.WinBiz/BasicData/F_PartOutQty.cs
  3. 16
      Stone.WinForm/Stone.WinBiz/JISAdmin/F_EDI_JIS5000Sequence.cs
  4. 9
      Stone.WinForm/Stone.WinModule/BasicData/F_Factory.cs
  5. 70
      Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.Designer.cs
  6. 12
      Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.cs
  7. 121
      Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.Designer.cs
  8. 60
      Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.cs
  9. 123
      Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.resx
  10. 55
      Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs
  11. 9
      Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj

63
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);
//}
}
}
}
}

60
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);
//}
}
}
}
}

16
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);
}
}

9
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;
}

70
Stone.WinForm/Stone.WinModule/BasicData/frmErrTypeLevelDetail.Designer.cs

@ -28,7 +28,7 @@
/// </summary>
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;

12
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();
}

121
Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.Designer.cs

@ -0,0 +1,121 @@
namespace Stone.WinModule.BasicData
{
partial class frmPartOutQtyDetail
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
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;
}
}

60
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();
}
}
}

123
Stone.WinForm/Stone.WinModule/BasicData/frmPartOutQtyDetail.resx

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

55
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<PartOutQty> lsPartOutQty = new List<PartOutQty>();
var lstSql = new List<string>();
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;

9
Stone.WinForm/Stone.WinModule/Stone.WinModule.csproj

@ -154,6 +154,12 @@
<Compile Include="BasicData\frmCallOff.Designer.cs">
<DependentUpon>frmCallOff.cs</DependentUpon>
</Compile>
<Compile Include="BasicData\frmPartOutQtyDetail.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="BasicData\frmPartOutQtyDetail.Designer.cs">
<DependentUpon>frmPartOutQtyDetail.cs</DependentUpon>
</Compile>
<Compile Include="BasicData\frmErrTypeLevelDetail.cs">
<SubType>Form</SubType>
</Compile>
@ -652,6 +658,9 @@
<EmbeddedResource Include="BasicData\frmColor.resx">
<DependentUpon>frmColor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BasicData\frmPartOutQtyDetail.resx">
<DependentUpon>frmPartOutQtyDetail.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="BasicData\frmErrTypeLevelDetail.resx">
<DependentUpon>frmErrTypeLevelDetail.cs</DependentUpon>
</EmbeddedResource>

Loading…
Cancel
Save