public string SET_TM_INSERT(string datastring1, string datastring2) { TokenINFO rst_TokenINFO = GET_TokenINFO(); //string token = AppClass.GetSession("token").ToString(); //int STAFFID = Convert.ToInt32(AppClass.GetSession("STAFFID")); MES_TM_TMINFO model_MES_TM_TMINFO = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_TM_TMINFO>(datastring1); model_MES_TM_TMINFO.JLR = rst_TokenINFO.STAFFID; model_MES_TM_TMINFO.TMCOUNT = 1; model_MES_TM_TMINFO.TMLB = 1; MES_TM_GL[] model_MES_TM_GL = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_TM_GL[]>(datastring2); MES_TM_TMINFO_INSERT_GL model_MES_TM_TMINFO_INSERT_GL = new MES_TM_TMINFO_INSERT_GL(); model_MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO = model_MES_TM_TMINFO; model_MES_TM_TMINFO_INSERT_GL.MES_TM_GL = model_MES_TM_GL; Sonluk.UI.Model.MES.TM_TMINFOService.MES_TM_TMINFO_INSERT_RETURN rst_MES_TM_TMINFO_INSERT_RETURN = mesmodels.TM_TMINFO.INSERT(model_MES_TM_TMINFO_INSERT_GL, 0, rst_TokenINFO.Token); return(Newtonsoft.Json.JsonConvert.SerializeObject(rst_MES_TM_TMINFO_INSERT_RETURN)); }
private void dybutton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(bstextBox.Text.Trim())) { if (string.IsNullOrEmpty(wstextBox.Text.Trim())) { ShowMeg(q(Msg_Type.msgbsnoempty)); return; } } if (Convert.ToInt32(hdgxcomboBox.SelectedValue) == 0) { ShowMeg(q(Msg_Type.msgxdnoempty)); return; } if (string.IsNullOrEmpty(mbsltextBox.Text.Trim())) { ShowMeg(q(Msg_Type.msgmbslnoempty)); return; } if (Convert.ToInt32(sbcdcomboBox.SelectedValue) == 384) { ShowMeg(q(Msg_Type.msgsbcdnoempty)); return; } //if (string.IsNullOrEmpty(bbpmtextBox.Text.Trim())) //{ // ShowMeg("包标喷码不能为空"); // return; //} if (fsnumericUpDown.Value <= 0) { ShowMeg(q(Msg_Type.msgprintnoempty)); return; } if (string.IsNullOrEmpty(bbpmtextBox.Text.Trim())) { ShowMeg(q(Msg_Type.msgbbpmnoempty)); return; } int ws = 0; if (!string.IsNullOrEmpty(wstextBox.Text.Trim())) { ws += Convert.ToInt32(wstextBox.Text.Trim()); } if (!string.IsNullOrEmpty(ypdctextBox.Text.Trim())) { ws += Convert.ToInt32(ypdctextBox.Text.Trim()); } string remark = ""; if (!string.IsNullOrEmpty(ypdctextBox.Text.Trim())) { remark += "[" + q(Msg_Type.titleyps) + ypdctextBox.Text.Trim() + "] " + bzrichTextBox.Text.Trim(); } else { remark = bzrichTextBox.Text.Trim(); } MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TH = Convert.ToInt32(zhtextBox.Text.Trim()); MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.CPZT = Convert.ToInt32(cpztcomboBox.SelectedValue); MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.REMARK = remark; if (Convert.ToInt32(sbcdcomboBox.SelectedValue) != 0) { MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.SBCD = Convert.ToInt32(sbcdcomboBox.SelectedValue); } else { ShowMeg(q(Msg_Type.msgsbcdnoempty)); return; } if (string.IsNullOrEmpty(bstextBox.Text.Trim())) { MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.DCSLBS = 0; } else { MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.DCSLBS = Convert.ToInt32(bstextBox.Text.Trim()); } MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.XDGX = Convert.ToInt32(hdgxcomboBox.SelectedValue); MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.DCSLMBSL = Convert.ToInt32(mbsltextBox.Text.Trim()); MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.DCSLYS = ws; MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.SL = Convert.ToDecimal(hjsltextBox.Text.Trim()); MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.RQM = bbpmtextBox.Text.Trim(); MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMCOUNT = 1; MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMSX = (int)Print_Type.bblot; MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.TMLB = 1; MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.MAC = DeviceInfo.GetNetCardMAC().Substring(0, 17); Sonluk.UI.Model.MES.TM_TMINFOService.MES_TM_TMINFO_INSERT_RETURN res = ServicModel.TM_TMINFO.INSERT(MES_TM_TMINFO_INSERT_GL, 0, getToken()); if (res.MES_RETURN.TYPE.Equals("S")) { PrintInfoByTM(res.SELECT_MES_TM_TMINFO_PRINT[0].MES_TM_TMINFO_LIST.TM, MES_TM_TMINFO_INSERT_GL.MES_TM_TMINFO.GC, Convert.ToInt32(fsnumericUpDown.Value), RigthType, PrintType); if (block != null) { block(); this.Close(); } } else { ShowMeg(res.MES_RETURN.MESSAGE); } }
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(); }