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