private void frmZX_TL_Shown(object sender, EventArgs e) { MES_TM_CZR rymodel = new MES_TM_CZR(); rymodel.GC = MES_PD_SCRW_LIST.GC; rymodel.RWBH = MES_PD_SCRW_LIST.RWBH; rymodel.CZLB = 1; dateTimePicker1.Text = MES_PD_SCRW_LIST.ZPRQ; _czrList = ServicModel.TM_CZR.SELECT_CZR_NOW(rymodel, getToken()); _bomList = ServicModel.PD_GD.SAP_GET_GDJGXX(MES_PD_SCRW_LIST.RWBH, MES_PD_SCRW_LIST.ZPRQ, MES_PD_SCRW_LIST.GC, getToken()); unRequireArr = new List <int>(); MES_SY_TYPEMX bcmodel = new MES_SY_TYPEMX(); bcmodel.GC = Convert.ToString(getGC("value")); bcmodel.TYPEID = 5; List <MES_SY_TYPEMXLIST> bcArr = new List <MES_SY_TYPEMXLIST>(); MES_SY_TYPEMXLIST[] bclist = ServicModel.SY_TYPEMX.SELECT(bcmodel, getToken()); gzzxtextBox.Text = MES_PD_SCRW_LIST.GZZXBH + "-" + MES_PD_SCRW_LIST.GZZXNAME; gctextBox.Text = MES_PD_SCRW_LIST.GC; sbhtextBox.Text = MES_PD_SCRW_LIST.SBH; MESlabel.Text = q(Msg_Type.titlemesgd) + MES_PD_SCRW_LIST.GDDH; //"MES工单:" GDHlabel.Text = q(Msg_Type.titlegd) + MES_PD_SCRW_LIST.ERPNO; //"工单号:" WLXXlabel.Text = q(Msg_Type.titlewlxx) + MES_PD_SCRW_LIST.WLH + "/" + MES_PD_SCRW_LIST.WLMS; //"物料信息:" WLLBlabel1.Text = q(Msg_Type.titlewllb) + MES_PD_SCRW_LIST.WLLBNAME; //"物料类别:" dclabel.Text = q(Msg_Type.titledcdjandxh) + MES_PD_SCRW_LIST.DCXHNAME + "/" + MES_PD_SCRW_LIST.DCDJNAME; //"电池型号/等级:" rwdlabel.Text = q(Msg_Type.titlerwd) + MES_PD_SCRW_LIST.RWBH; //"任务单:" configBom(); if (_bomList.MES_RETURN.TYPE.Equals("S")) { BOMdataGridView.DataSource = getBomList(_bomList); } else { ShowMeg(_bomList.MES_RETURN.MESSAGE); //this.Close(); BOMdataGridView.DataSource = new List <BomDataGrid>(); } BOMdataGridView.ClearSelection(); LSdataGridView.ReadOnly = true; LastDate = dateTimePicker1.Text.Trim(); ConfigJsDataGridView(); LSdataGridView.ClearSelection(); BOMdataGridView.ClearSelection(); button3.Text = q(Msg_Type.fieldhidden);// "隐藏"; IShidden(true); }
public void UpdateJSDataGrid(string rwbh) { Sonluk.UI.Model.MES.PD_TLGLService.MES_PD_TL model = new Sonluk.UI.Model.MES.PD_TLGLService.MES_PD_TL(); model.RWBH = rwbh; MES_PD_TL_SELECT res = ServicModel.PD_TLGL.SELECT(model, getToken()); if (res.MES_RETURN.TYPE.Equals("S")) { List <TMDataGrid> list = new List <TMDataGrid>(); JlList = res.MES_PD_TL_LIST; for (int i = 0; i < res.MES_PD_TL_LIST.Length; i++) { TMDataGrid node = new TMDataGrid(); node.Xh = (res.MES_PD_TL_LIST.Length - i).ToString(); node.Tm = res.MES_PD_TL_LIST[i].TM; node.Wlxx = res.MES_PD_TL_LIST[i].WLH + "/" + res.MES_PD_TL_LIST[i].WLMS; node.Wllb = res.MES_PD_TL_LIST[i].WLLBNAME; node.Tlsj = res.MES_PD_TL_LIST[i].TLRQ; list.Add(node); } LSdataGridView.DataSource = list; LSdataGridView.ClearSelection(); } else { if (res.MES_RETURN.MESSAGE.Equals("无数据"))//暂不修改 { List <TMDataGrid> list = new List <TMDataGrid>(); JlList = res.MES_PD_TL_LIST; LSdataGridView.DataSource = list; LSdataGridView.ClearSelection(); } else { ShowMeg(res.MES_RETURN.MESSAGE); } } SMtextBox.Select(); }
private void getTMList(SELECT_MES_TM_TMINFO_BYTM model, int first) { for (int x = 0; x < model.MES_TM_TMINFO_LIST.Length; x++) { IList <TMDataGrid> nodes = new List <TMDataGrid>(); TMDataGrid node = new TMDataGrid(); if (model.MES_TM_TMINFO_LIST.Length <= 0) { //MessageBox.Show("扫描的是无效的条码", "消息框"); ShowMeg(q(Msg_Type.msgscantminvalid)); SMtextBox.Clear(); return; } node.Tm = model.MES_TM_TMINFO_LIST[x].TM; node.Wlxx = model.MES_TM_TMINFO_LIST[x].WLH + "/" + model.MES_TM_TMINFO_LIST[x].WLMS; node.Wllb = model.MES_TM_TMINFO_LIST[x].WLLBNAME; //node.Bz = model.MES_TM_TMINFO_LIST[0].REMARK; node.Wllbdm = model.MES_TM_TMINFO_LIST[x].WLLB; node.Gc = model.MES_TM_TMINFO_LIST[0].GC; node.Tltmid = model.MES_TM_TMINFO_LIST[x].TLTMID; //node.Tmid = model.MES_TM_TMINFO_LIST[0].TM; //bool isBom = false; if (_bomList.ET_BOM != null) { for (int i = 0; i < _bomList.ET_BOM.Length; i++) { if (_bomList.ET_BOM[i].WLLB == node.Wllbdm) { BOMdataGridView.Rows[i].Cells[q(Msg_Type.fieldstatus)].Style.BackColor = Color.FromArgb(187, 255, 102);//"状态" } } } else { } //if (isBom == false) //{ // if (MessageBox.Show("你扫描的条码不是物料的BOM组成部分!!", "消息框", MessageBoxButtons.OK) == DialogResult.OK) // { // SMtextBox.Clear(); // } // return; //} bool replace = false; if (Tmlist.Count > 0) { for (int i = 0; i < Tmlist.Count; i++) { if (node.Wllbdm == Tmlist[i].Wllbdm) { replace = true; Tmlist[i] = node; } } if (replace == false) { Tmlist.Add(node); } } else { Tmlist.Add(node); } for (int i = 0; i < Tmlist.Count; i++) { Tmlist[i].Xh = (i + 1).ToString(); } if (RigthType == Rigth_Type.mfqqingxi) { pctextBox.Text = model.MES_TM_TMINFO_LIST[x].PC; } LSdataGridView.DataSource = Tmlist.ToList(); LSdataGridView.ClearSelection(); LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;//"删除" } if (first == 1) { if (model.MES_TM_TMINFO_LIST.Length == 1) { //MessageBox.Show("投料成功!!!", "消息框"); ShowMeg(q(Msg_Type.msgtlsuccess), 1500);//"投料成功" } } SMtextBox.Clear(); SMtextBox.Select(); }
public void ChangeRW() { MES_PD_SCRW model = new MES_PD_SCRW(); model.RWBH = SMtextBox.Text.Trim().ToUpper(); model.GC = getGC("value"); model.SBBH = SBHID; SELECT_MES_PD_SCRW res = ServicModel.PD_SCRW.SELECT(model, getToken()); if (res.MES_RETURN.TYPE.Equals("S")) { MES_PD_SCRW_LIST list = res.MES_PD_SCRW_LIST[0]; Tmlist = new List <TMDataGrid>(); LSdataGridView.DataSource = Tmlist; LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;//"删除" this._MES_PD_SCRW_LIST = list; MES_TM_CZR rymodel = new MES_TM_CZR(); rymodel.GC = list.GC; rymodel.RWBH = list.RWBH; rymodel.CZLB = 1; _czrList = ServicModel.TM_CZR.SELECT_CZR_NOW(rymodel, getToken()); _bomList = ServicModel.PD_GD.SAP_GET_GDJGXX(list.RWBH, dateTimePicker1.Text.Trim(), list.GC, getToken()); unRequireArr = new List <int>(); MES_SY_TYPEMX bcmodel = new MES_SY_TYPEMX(); bcmodel.GC = Convert.ToString(getGC("value")); bcmodel.TYPEID = 5; List <MES_SY_TYPEMXLIST> bcArr = new List <MES_SY_TYPEMXLIST>(); MES_SY_TYPEMXLIST[] bclist = ServicModel.SY_TYPEMX.SELECT(bcmodel, getToken()); gzzxtextBox.Text = list.GZZXBH + "-" + list.GZZXNAME; czrytextBox.Text = _czrList.CZR; gctextBox.Text = list.GC; sbhtextBox.Text = list.SBH; pctextBox.Text = list.PC; bcArr = bclist.ToList(); MES_SY_TYPEMXLIST bcmodel1 = new MES_SY_TYPEMXLIST(); bcmodel1.ID = 0; bcmodel1.MXNAME = q(Msg_Type.titlechoice);//"==请选择=="; bcArr.Insert(0, bcmodel1); bccomboBox.DisplayMember = "MXNAME"; bccomboBox.ValueMember = "ID"; bccomboBox.DataSource = bcArr; bccomboBox.SelectedValue = list.BC; MESlabel.Text = q(Msg_Type.titlemesgd) + list.GDDH; //"MES工单:" GDHlabel.Text = q(Msg_Type.titlegd) + list.ERPNO; //"工单号:" WLXXlabel.Text = q(Msg_Type.titlewlxx) + list.WLH + "/" + list.WLMS; //"物料信息:" WLLBlabel1.Text = q(Msg_Type.titlewllb) + list.WLLBNAME; //"物料类别:" rwdlabel.Text = q(Msg_Type.titlerwd) + list.RWBH; //"任务单:" if (_bomList.MES_RETURN.TYPE.Equals("S")) { BOMdataGridView.DataSource = getBomList(_bomList); } else { ShowMeg(_bomList.MES_RETURN.MESSAGE); BOMdataGridView.DataSource = new List <BomDataGrid>(); } //scrqtextBox.Text = DateTime.Now.ToString("yyyy-MM-dd"); LSdataGridView.ReadOnly = true; BOMdataGridView.Columns[q(Msg_Type.fieldstatus)].DefaultCellStyle.BackColor = Color.Red;//"状态" for (int i = 0; i < unRequireArr.Count; i++) { BOMdataGridView.Rows[unRequireArr[i]].Cells[q(Msg_Type.fieldstatus)].Style.BackColor = Color.White;//"状态" } //SELECT_MES_TM_TMINFO_BYTM r = ServicModel.TM_TMINFO.SELECT_TL_LAST(MES_PD_SCRW_LIST.RWBH, getToken()); //if (r.MES_RETURN.TYPE.Equals("S")) //{ // getTMList(r, 0); //} Tmlist = new List <TMDataGrid>(); LSdataGridView.DataSource = new List <TMDataGrid>(); LSdataGridView.ClearSelection(); LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4;//"删除" BOMdataGridView.ClearSelection(); if (RigthType == Rigth_Type.mfqqingxi) { GDHlabel.Visible = false; WLXXlabel.Location = GDHlabel.Location; } } else { //MessageBox.Show(SMtextBox.Text + res.MES_RETURN.MESSAGE, "消息框"); ShowMeg(SMtextBox.Text + res.MES_RETURN.MESSAGE); } SMtextBox.Clear(); SMtextBox.Select(); }
private void LSdataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { if (this.LSdataGridView.CurrentCell.OwningColumn.Name == q(Msg_Type.fielddelete)) //"删除" { int tmtmid = Convert.ToInt32(this.LSdataGridView.CurrentRow.Cells[q(Msg_Type.fieldtltmdm)].Value); //"投料条码代码" //MES_RETURN_UI res = ServicModel.PD_TLGL.DELETE(tmtmid, getToken()); //if (res.TYPE.Equals("S")) //{ int id = Convert.ToInt32(this.LSdataGridView.CurrentRow.Cells[q(Msg_Type.fieldxh)].Value); //"序号" Tmlist.RemoveAt(id - 1); for (int i = 0; i < Tmlist.Count; i++) { Tmlist[i].Xh = (i + 1).ToString(); } int a = LSdataGridView.Columns.Count; if (Tmlist.Count == 0) { LSdataGridView.DataSource = new List <TMDataGrid>(); LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4; //"删除" } else { LSdataGridView.DataSource = Tmlist.ToArray(); LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4; // } LSdataGridView.ClearSelection(); //BOMdataGridView.Rows[0].Cells["状态"].Style.BackColor = Color.Red; //BOMdataGridView.Rows[1].Cells["状态"].Style.BackColor = Color.Red; //for (int i = 0; i < unRequireArr.Count; i++) //{ // BOMdataGridView.Rows[unRequireArr[i]].Cells["状态"].Style.BackColor = Color.White; //} for (int i = 0; i < BOMdataGridView.Rows.Count; i++) { BOMdataGridView.Rows[i].Cells[q(Msg_Type.fieldstatus)].Style.BackColor = Color.Red; //"状态" for (int j = 0; j < unRequireArr.Count; j++) { if (i == unRequireArr[j]) { BOMdataGridView.Rows[i].Cells[q(Msg_Type.fieldstatus)].Style.BackColor = Color.White; //"状态" } } } for (int i = 0; i < _bomList.ET_BOM.Length; i++) { for (int j = 0; j < Tmlist.Count; j++) { //if (_bomList.ET_BOM[i].ZSBS.Equals("Y")) //{ // if (_bomList.ET_BOM[i].IDNRK == Tmlist[j].Wlxx.Split('/')[0]) // { // BOMdataGridView.Rows[i].Cells["状态"].Style.BackColor = Color.FromArgb(187, 255, 102); // } //} //else //{ if (_bomList.ET_BOM[i].WLLB == Tmlist[j].Wllbdm) { BOMdataGridView.Rows[i].Cells[q(Msg_Type.fieldstatus)].Style.BackColor = Color.FromArgb(187, 255, 102); //"状态" } //} } } //} //else //{ // MessageBox.Show(res.MESSAGE, "消息框"); //} } } }
private void frmTL2_Load(object sender, EventArgs e) { //dataGridView1.ClearSelection(); BOMdataGridView.ClearSelection(); LSdataGridView.ClearSelection(); }
private void dylotbutton_Click(object sender, EventArgs e) { ZBCFUN_GDJGXX_READ r = ServicModel.PD_GD.SAP_GET_GDJGXX(MES_PD_SCRW_LIST.RWBH, MES_PD_SCRW_LIST.ZPRQ, MES_PD_SCRW_LIST.GC, getToken()); if (!r.MES_RETURN.TYPE.Equals("S")) { ShowMeg(r.MES_RETURN.MESSAGE); SMtextBox.Select(); return; } if (!IsTMP) { //ShowMeg("请先扫描托盘码"); ShowMeg(q(Msg_Type.msgscantpm)); } else { MsgReturn msgInfo = VerifyWLisALL(); if (msgInfo.Pass == false) { //MessageBox.Show(msgInfo.Msg, "消息框"); ShowMeg(msgInfo.Msg); SMtextBox.Select(); return; } MsgReturn msgInfo1 = VerifyContent(); if (msgInfo1.Pass == false) { //MessageBox.Show(msgInfo1.Msg, "消息框"); ShowMeg(msgInfo1.Msg); SMtextBox.Select(); return; } if (string.IsNullOrEmpty(Tpm)) { //ShowMeg("托盘码信息不能为空"); ShowMeg(q(Msg_Type.msgtpmnoempty)); } //if (Convert.ToInt32(bccomboBox.SelectedValue) == 0) //{ // MessageBox.Show("生成领用表必须输入班次信息不能为空", "消息框"); // return; //} MES_TM_TMINFO_INSERT_GL model = new MES_TM_TMINFO_INSERT_GL(); MES_TM_TMINFO info = new MES_TM_TMINFO(); model.MES_TM_TMINFO = info; model.MES_TM_TMINFO.TMLB = 1; //model.MES_TM_TMINFO.BC = Convert.ToInt32(bccomboBox.SelectedValue); model.MES_TM_TMINFO.RWBH = MES_PD_SCRW_LIST.RWBH; model.MES_TM_TMINFO.PC = MES_PD_SCRW_LIST.PC; model.MES_TM_TMINFO.JLR = Convert.ToInt32(getUserInfo("staffid")); model.MES_TM_TMINFO.GC = MES_PD_SCRW_LIST.GC; model.MES_TM_TMINFO.SL = MES_PD_SCRW_LIST.SL; model.MES_TM_TMINFO.TPM = Tpm; model.MES_TM_TMINFO.TMCOUNT = 1; model.MES_TM_TMINFO.MAC = DeviceInfo.GetNetCardMAC().Substring(0, 17); //model.MES_TM_TMINFO.TMSX = Print_Type. IList <MES_TM_GL> nodes = new List <MES_TM_GL>(); for (int i = 0; i < Tmlist.Count; i++) { MES_TM_GL node = new MES_TM_GL(); node.XCTM = Tmlist[i].Tm; node.XCTMGC = Tmlist[i].Gc; nodes.Add(node); } model.MES_TM_GL = nodes.ToArray(); Sonluk.UI.Model.MES.TM_TMINFOService.MES_TM_TMINFO_INSERT_RETURN res = ServicModel.TM_TMINFO.INSERT(model, 0, getToken()); if (res.MES_RETURN.TYPE.Equals("S")) { //ShowMeg("关联成功", 1500); ShowMeg(q(Msg_Type.msgglsuccess), 1500); //if (MessageBox.Show("关联成功", "消息框", MessageBoxButtons.OK) == DialogResult.OK) //{ string printToHome = ini.IniReadValue(ini.Section_Configuration, "printTohome"); if (printToHome.Equals("true")) { zybutton.PerformClick(); } IsTMP = false; BomList = new ZBCFUN_GDJGXX_READ(); List <BomDataGrid> list = new List <BomDataGrid>(); BOMdataGridView.DataSource = list; BomList = null; Tmlist = new List <TMDataGrid>(); LSdataGridView.DataSource = Tmlist.ToList(); LSdataGridView.ClearSelection(); LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4; MES_PD_SCRW_LIST = new MES_PD_SCRW_LIST(); MESlabel.Text = q(Msg_Type.titlemesgd) + MES_PD_SCRW_LIST.GDDH; GDHlabel.Text = q(Msg_Type.titlegd) + MES_PD_SCRW_LIST.ERPNO; WLXXlabel.Text = q(Msg_Type.titlewlxx); WLLBlabel1.Text = q(Msg_Type.titlewllb) + MES_PD_SCRW_LIST.WLLBNAME; rwdlabel.Text = q(Msg_Type.titlerwd) + MES_PD_SCRW_LIST.RWBH; tpmlabel.Text = q(Msg_Type.titletpm);//"托盘码:"; Tpm = SMtextBox.Text.Trim(); //dcdjlabel.Text = "电池等级:" + list.DCDJNAME; //dcxhlabel1.Text = "电池型号:" + list.DCXHNAME; if (!string.IsNullOrEmpty(MES_PD_SCRW_LIST.XSNOBILL) && !string.IsNullOrEmpty(MES_PD_SCRW_LIST.XSNOBILLMX)) { tskclabel1.Text = q(Msg_Type.titletskc) + MES_PD_SCRW_LIST.XSNOBILL + "-" + MES_PD_SCRW_LIST.XSNOBILLMX; } else { tskclabel1.Text = q(Msg_Type.titletskc); } //} } else { ShowMeg(res.MES_RETURN.MESSAGE); } } SMtextBox.Select(); }
private void getTMList(SELECT_MES_TM_TMINFO_BYTM model) { for (int x = 0; x < model.MES_TM_TMINFO_LIST.Length; x++) { IList <TMDataGrid> nodes = new List <TMDataGrid>(); TMDataGrid node = new TMDataGrid(); if (model.MES_TM_TMINFO_LIST.Length <= 0) { //MessageBox.Show("扫描的是无效的条码", "消息框"); ShowMeg(q(Msg_Type.msgscantminvalid)); SMtextBox.Clear(); SMtextBox.Select(); return; } node.Tm = model.MES_TM_TMINFO_LIST[x].TM; node.Wlxx = model.MES_TM_TMINFO_LIST[x].WLH + "/" + model.MES_TM_TMINFO_LIST[x].WLMS; node.Wllb = model.MES_TM_TMINFO_LIST[x].WLLBNAME; //node.Bz = model.MES_TM_TMINFO_LIST[0].REMARK; node.Wllbdm = model.MES_TM_TMINFO_LIST[x].WLLB; node.Gc = model.MES_TM_TMINFO_LIST[0].GC; node.Tltmid = model.MES_TM_TMINFO_LIST[x].TLTMID; //node.Tmid = model.MES_TM_TMINFO_LIST[0].TM; bool isBom = false; for (int i = 0; i < _bomList.ET_BOM.Length; i++) { //if (_bomList.ET_BOM[i].ZSBS.Equals("Y")) //{ // if (_bomList.ET_BOM[i].IDNRK == node.Wlxx.Split('/')[0]) // { // isBom = true; // BOMdataGridView.Rows[i].Cells["状态"].Style.BackColor = Color.FromArgb(187, 255, 102); // } //} //else //{ if (_bomList.ET_BOM[i].WLLB == node.Wllbdm) { isBom = true; BOMdataGridView.Rows[i].Cells[q(Msg_Type.fieldstatus)].Style.BackColor = Color.FromArgb(187, 255, 102); } //} } if (isBom == false) { if (MessageBox.Show(q(Msg_Type.msgbominvalid), q(Msg_Type.msgtitle), MessageBoxButtons.OK) == DialogResult.OK) { SMtextBox.Clear(); SMtextBox.Select(); } return; } bool replace = false; if (Tmlist.Count > 0) { for (int i = 0; i < Tmlist.Count; i++) { if (node.Tm == Tmlist[i].Tm) { replace = true; } } if (replace == false) { Tmlist.Add(node); } else { //ShowMeg("条码" + SMtextBox.Text + "不允许重复添加"); ShowMeg(string.Format(q(Msg_Type.msgtmcf), SMtextBox.Text)); return; } } else { Tmlist.Add(node); } for (int i = 0; i < Tmlist.Count; i++) { Tmlist[i].Xh = (i + 1).ToString(); } LSdataGridView.DataSource = Tmlist.ToList(); LSdataGridView.ClearSelection(); LSdataGridView.Columns[q(Msg_Type.fielddelete)].DisplayIndex = 4; } if (model.MES_TM_TMINFO_LIST.Length == 1) { //MessageBox.Show("投料成功!!!", "消息框"); ShowMeg(q(Msg_Type.msgtlsuccess), 1500); } SMtextBox.Clear(); SMtextBox.Select(); }
private void getTMList(SELECT_MES_TM_TMINFO_BYTM model) { for (int x = 0; x < model.MES_TM_TMINFO_LIST.Length; x++) { IList <TMDataGrid> nodes = new List <TMDataGrid>(); TMDataGrid node = new TMDataGrid(); if (model.MES_TM_TMINFO_LIST.Length <= 0) { MessageBox.Show("扫描的是无效的条码", "消息框"); SMtextBox.Clear(); return; } node.Tm = model.MES_TM_TMINFO_LIST[x].TM; node.Wlxx = model.MES_TM_TMINFO_LIST[x].WLH + "/" + model.MES_TM_TMINFO_LIST[x].WLMS; node.Wllb = model.MES_TM_TMINFO_LIST[x].WLLBNAME; //node.Bz = model.MES_TM_TMINFO_LIST[0].REMARK; node.Wllbdm = model.MES_TM_TMINFO_LIST[x].WLLB; node.Gc = model.MES_TM_TMINFO_LIST[0].GC; node.Tltmid = model.MES_TM_TMINFO_LIST[x].TLTMID; //node.Tmid = model.MES_TM_TMINFO_LIST[0].TM; bool isBom = false; for (int i = 0; i < _bomList.ET_BOM.Length; i++) { if (_bomList.ET_BOM[i].ZSBS.Equals("Y")) { if (_bomList.ET_BOM[i].IDNRK == node.Wlxx.Split('/')[0]) { isBom = true; //BOMdataGridView.Rows[i].DefaultCellStyle.BackColor = Color.Cyan; //BOMdataGridView.Columns["状态"].DefaultCellStyle.BackColor = Color.Red; BOMdataGridView.Rows[i].Cells["状态"].Style.BackColor = Color.FromArgb(187, 255, 102); } } else { if (_bomList.ET_BOM[i].WLLB == node.Wllbdm) { isBom = true; BOMdataGridView.Rows[i].Cells["状态"].Style.BackColor = Color.FromArgb(187, 255, 102); } } } if (isBom == false) { if (MessageBox.Show("你扫描的条码不是物料的BOM组成部分!!", "消息框", MessageBoxButtons.OK) == DialogResult.OK) { SMtextBox.Clear(); } return; } bool replace = false; if (Tmlist.Count > 0) { for (int i = 0; i < Tmlist.Count; i++) { if (node.Wllbdm == Tmlist[i].Wllbdm) { replace = true; Tmlist[i] = node; } } if (replace == false) { Tmlist.Add(node); } } else { Tmlist.Add(node); } for (int i = 0; i < Tmlist.Count; i++) { Tmlist[i].Xh = (i + 1).ToString(); } LSdataGridView.DataSource = Tmlist.ToList(); LSdataGridView.ClearSelection(); LSdataGridView.Columns["删除"].DisplayIndex = 4; } if (model.MES_TM_TMINFO_LIST.Length == 1) { MessageBox.Show("投料成功!!!", "消息框"); } SMtextBox.Clear(); }
public void RefreshRW(MES_PD_SCRW_LIST list, string shebeihaoID) { this._MES_PD_SCRW_LIST = list; Tmlist = new List <TMDataGrid>(); MES_TM_CZR rymodel = new MES_TM_CZR(); rymodel.GC = list.GC; rymodel.RWBH = list.RWBH; rymodel.CZLB = 1; _czrList = ServicModel.TM_CZR.SELECT_CZR_NOW(rymodel, getToken()); _bomList = ServicModel.PD_GD.SAP_GET_GDJGXX(list.RWBH, dateTimePicker1.Text.Trim(), list.GC, getToken()); unRequireArr = new List <int>(); MES_SY_TYPEMX bcmodel = new MES_SY_TYPEMX(); bcmodel.GC = Convert.ToString(getGC("value")); bcmodel.TYPEID = 5; List <MES_SY_TYPEMXLIST> bcArr = new List <MES_SY_TYPEMXLIST>(); MES_SY_TYPEMXLIST[] bclist = ServicModel.SY_TYPEMX.SELECT(bcmodel, getToken()); gzzxtextBox.Text = list.GZZXBH + "-" + list.GZZXNAME; czrytextBox.Text = _czrList.CZR; gctextBox.Text = list.GC; sbhtextBox.Text = list.SBH; pctextBox.Text = list.PC; MES_SY_TYPEMXLIST bcmodel1 = new MES_SY_TYPEMXLIST(); bcmodel1.ID = 0; bcmodel1.MXNAME = "==请选择=="; bcArr = bclist.ToList(); bcArr.Insert(0, bcmodel1); bccomboBox.DisplayMember = "MXNAME"; bccomboBox.ValueMember = "ID"; bccomboBox.DataSource = bcArr; bccomboBox.SelectedValue = list.BC; MESlabel.Text = "MES工单:" + list.GDDH; GDHlabel.Text = "工单号:" + list.ERPNO; WLXXlabel.Text = "物料信息:" + list.WLH + "/" + list.WLMS; WLLBlabel1.Text = "物料类别:" + list.WLLBNAME; rwdlabel.Text = "任务单:" + list.RWBH; BOMdataGridView.DataSource = getBomList(_bomList); //scrqtextBox.Text = DateTime.Now.ToString("yyyy-MM-dd"); LSdataGridView.ReadOnly = true; BOMdataGridView.Columns["状态"].DefaultCellStyle.BackColor = Color.Red; for (int i = 0; i < unRequireArr.Count; i++) { BOMdataGridView.Rows[unRequireArr[i]].Cells["状态"].Style.BackColor = Color.White; } SELECT_MES_TM_TMINFO_BYTM r = ServicModel.TM_TMINFO.SELECT_TL_LAST(MES_PD_SCRW_LIST.RWBH, getToken()); if (r.MES_RETURN.TYPE.Equals("S")) { getTMList(r, 0); } else { Tmlist = new List <TMDataGrid>(); LSdataGridView.DataSource = new List <TMDataGrid>(); LSdataGridView.ClearSelection(); LSdataGridView.Columns["删除"].DisplayIndex = 4; } if (RigthType == Rigth_Type.mfqqingxi) { GDHlabel.Visible = false; WLXXlabel.Location = GDHlabel.Location; } }