using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using UAS_MES.DataOperate; using UAS_MES.Entity; using UAS_MES.PublicMethod; namespace UAS_MES.Special { public partial class Special_ChangeSNCraft : Form { DataHelper dh = SystemInf.dh; DataTable Dbfind; public Special_ChangeSNCraft() { InitializeComponent(); } private void Special_ChangeSNCraft_Load(object sender, EventArgs e) { cr_code.TableName = "craft left join product on cr_prodcode=pr_code"; cr_code.SelectField = "cr_code # 途程编号,cr_name # 途程名称,cr_prodcode # 产品编号,pr_detail # 产品名称 ,pr_spec # 产品规格"; cr_code.FormName = Name; cr_code.SetValueField = new string[] { "cr_code" }; cr_code.Condition = "cr_statuscode='AUDITED'"; cr_code.DbChange += Cr_code_DbChange; } private void Cr_code_DbChange(object sender, EventArgs e) { Dbfind = cr_code.ReturnData; BaseUtil.SetFormValue(this.Controls, Dbfind); } private void Confirm_Click(object sender, EventArgs e) { if (sn_code.Text != "") { DataTable dt = (DataTable)dh.ExecuteSql("select ms_id from makeserial where ms_sncode='" + sn_code.Text + "' order by ms_id desc", "select"); if (dt.Rows.Count > 0) { string msid = dt.Rows[0]["ms_id"].ToString(); } else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red); } else OperateResult.AppendText(">>序列号" + sn_code.Text + "不能为空\n", Color.Red); } } }