public MES_RETURN_UI ZX_CC_NOUPDATE_TIME(MES_PD_SCRW_ZXCC_INSERT model, string ptoken) { MES_RETURN mr = client.ZX_CC_NOUPDATE_TIME(model, ptoken); MES_RETURN_UI mrui = new MES_RETURN_UI(); mrui.TYPE = mr.TYPE; mrui.MESSAGE = mr.MESSAGE; mrui.GC = mr.GC; mrui.TM = mr.TM; return(mrui); }
public string POST_ZFDC_CC(string datastring, string datastring2) { string token = AppClass.GetSession("token").ToString(); int STAFFID = Convert.ToInt32(AppClass.GetSession("STAFFID")); MES_PD_SCRW_ZXCC_INSERT model = Newtonsoft.Json.JsonConvert.DeserializeObject <MES_PD_SCRW_ZXCC_INSERT>(datastring); model.JLR = STAFFID; Sonluk.UI.Model.MES.PD_SCRWService.MES_TM_ZFDCMX[] model2 = Newtonsoft.Json.JsonConvert.DeserializeObject <Sonluk.UI.Model.MES.PD_SCRWService.MES_TM_ZFDCMX[]>(datastring2); model.MES_TM_ZFDCMX = model2; MES_RETURN_UI rst = mesModels.PD_SCRW.ZX_CC_NOUPDATE_TIME(model, token); return(Newtonsoft.Json.JsonConvert.SerializeObject(rst)); }
private void dybutton_Click(object sender, EventArgs e) { #region verify if (string.IsNullOrEmpty(zhtextBox.Text.Trim())) { ShowMeg(q(Msg_Type.msgzhnoempty));//"幢号信息不能为空"); return; } if (string.IsNullOrEmpty(kssjdateTimePicker.Text.Trim())) { ShowMeg(q(Msg_Type.msgslkssjnoempty));//"开始时间不能为空"); return; } if (judge.IsDate(jssjdateTimePicker.Text.Trim()) == false) { //ShowMeg("开始时间不能正确的时间格式"); ShowMeg(q(Msg_Type.msgkssjformat)); return; } if (string.IsNullOrEmpty(jssjdateTimePicker.Text.Trim())) { ShowMeg(q(Msg_Type.msgjssjnoempty));//"结束时间不能为空"); return; } if (judge.IsDate(jssjdateTimePicker.Text.Trim()) == false) { ShowMeg(q(Msg_Type.msgjssjformat)); return; } TimeSpan midtine = DateTime.Parse(jssjdateTimePicker.Text.Trim()) - DateTime.Parse(kssjdateTimePicker.Text.Trim()); if (midtine.TotalMinutes < 0) { ShowMeg(q(Msg_Type.msgksgtjs)); return; } else if (midtine.TotalMinutes == 0) { ShowMeg(q(Msg_Type.msgkssjnqjssj));//"开始时间不能等于结束时间" return; } if (Convert.ToInt32(fsnumericUpDown.Value) <= 0) { ShowMeg(q(Msg_Type.msgprintnoempty));//"打印张数必须大于0"); return; } if (string.IsNullOrEmpty(pctextBox.Text.Trim())) { ShowMeg(q(Msg_Type.msgpcnoempty));//"批次信息不能为空"); return; } if (pctextBox.Text.Trim().Length > 10) { ShowMeg(q(Msg_Type.msgpclengthten));//"批次信息不能超过10位"); return; } if (string.IsNullOrEmpty(bstextBox.Text.Trim())) { ShowMeg(q(Msg_Type.msgbsnoempty));//"板数信息不能为空"); return; } if (string.IsNullOrEmpty(mbsltextBox.Text.Trim())) { ShowMeg(q(Msg_Type.msgmbslnoempty));//"每板数量不能为空"); return; } if (MES_PD_SCRW_LIST.GC == BranchGC) { if (!bzrichTextBox.Text.Contains(ZXVerifyStr)) { ShowMeg("工厂" + MES_PD_SCRW_LIST.GC + "必须有\"" + ZXVerifyStr + "\"信息"); return; } else { //int index = bzrichTextBox.Text.IndexOf(ZXVerifyStr) + 4; //if (bzrichTextBox.Text.Length == index) //{ // ShowMeg(MES_PD_SCRW_LIST.GCDYMS + "必须填写\""+ZXVerifyStr+"\" 相关信息"); // return; //} } } #endregion int ws = 0; if (IsLR61scx) { if (Convert.ToString(sdxtcombobox.SelectedValue).Equals("0")) { ShowMeg(q(Msg_Type.msglr61havesdxt));//"LR61素电必须选择素电线体" return; } } if (!string.IsNullOrEmpty(wstextBox.Text.Trim())) { ws = Convert.ToInt32(wstextBox.Text.Trim()); } MES_PD_SCRW_ZXCC_INSERT model = new MES_PD_SCRW_ZXCC_INSERT(); if (!Convert.ToString(zflbcomboBox.SelectedValue).Equals("0")) { model.ZFDCLB = Convert.ToInt32(zflbcomboBox.SelectedValue); } model.GC = MES_PD_SCRW_LIST.GC; model.RWBH = MES_PD_SCRW_LIST.RWBH; model.TH = Convert.ToInt32(zhtextBox.Text.Trim()); model.KSTIME = kssjdateTimePicker.Text.Trim(); model.JSTIME = jssjdateTimePicker.Text.Trim(); model.JLR = Convert.ToInt32(getUserInfo("staffid")); model.CPZT = Convert.ToInt32(cpztcomboBox.SelectedValue); model.PC = pctextBox.Text.Trim(); model.REMARK = bzrichTextBox.Text; model.DCSLBS = Convert.ToInt32(bstextBox.Text.Trim()); model.DCSLMBSL = Convert.ToInt32(mbsltextBox.Text.Trim()); model.DCSLYS = ws; model.SL = Convert.ToDecimal(hjsltextBox.Text.Trim()); model.TMSX = (int)Print_Type.zxlot; model.TMLB = 1; model.MAC = DeviceInfo.GetNetCardMAC().Substring(0, 17); MES_RETURN_UI res = ServicModel.PD_SCRW.ZX_CC(model, getToken()); if (res.TYPE.Equals("S")) { PrintInfoByTM(res.TM, res.GC, Convert.ToInt32(fsnumericUpDown.Value), RigthType, Print_Type.zxlot); if (block != null) { block(model.RWBH); this.Close(); } } else { ShowMeg(res.MESSAGE); } }
private void dybutton_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(zhtextBox.Text.Trim())) { ShowMeg("幢号信息不能为空"); return; } if (string.IsNullOrEmpty(dateTimePicker1.Text.Trim())) { ShowMeg("生产开始时间不能为空"); return; } if (string.IsNullOrEmpty(dateTimePicker2.Text.Trim())) { ShowMeg("生产结束时间不能为空"); return; } if (!judge.IsDate(dateTimePicker1.Text.Trim())) { ShowMeg("生产开始时间不是有效的时间格式"); return; } if (!judge.IsDate(dateTimePicker2.Text.Trim())) { ShowMeg("生产结束时间不是有效的时间格式"); return; } TimeSpan midtine = DateTime.Parse(dateTimePicker1.Text.Trim()) - DateTime.Parse(dateTimePicker2.Text.Trim()); if (midtine.Seconds > 0) { ShowMeg("生产开始时间不能大于结束时间"); return; } if (fsnumericUpDown1.Value == 0) { ShowMeg("打印分数不能为0"); return; } if (string.IsNullOrEmpty(cftstextBox.Text.Trim())) { ShowMeg("存放天数不能为空"); return; } //if (string.IsNullOrEmpty(sdzsltextBox.Text.Trim())) //{ // ShowMeg("素电总数量不能为空"); // return; //} MES_PD_SCRW_ZXCC_INSERT model = new MES_PD_SCRW_ZXCC_INSERT(); model.GC = MES_PD_SCRW_LIST.GC; model.TH = Convert.ToInt32(zhtextBox.Text.Trim()); model.KSTIME = dateTimePicker1.Text.Trim(); //scsjfromtextBox.Text.Trim(); model.JSTIME = dateTimePicker2.Text.Trim(); //scsjtotextBox.Text.Trim(); model.JLR = Convert.ToInt16(getUserInfo("staffid")); model.PC = MES_PD_SCRW_LIST.PC; model.REMARK = bzrichTextBox.Text.Trim(); model.ZFDCLB = Convert.ToInt32(zflbcomboBox.SelectedValue); model.CFTS = Convert.ToInt32(cftstextBox.Text.Trim()); model.RWBH = MES_PD_SCRW_LIST.RWBH; model.TMSX = (int)Print_Type.zfsd; model.TMLB = 1; model.MAC = DeviceInfo.GetNetCardMAC().Substring(0, 17); List <MES_TM_ZFDCMX> submodel = new List <MES_TM_ZFDCMX>(); bool ispass = true; int index2 = 0; int sum = 0; for (int i = 0; i < jldataGridView.Rows.Count; i++) { MES_TM_ZFDCMX node = new MES_TM_ZFDCMX(); node.JSTIME = Convert.ToString(jldataGridView.Rows[i].Cells[2].Value); node.KSTIME = Convert.ToString(jldataGridView.Rows[i].Cells[1].Value); node.SL = Convert.ToInt32(jldataGridView.Rows[i].Cells[3].Value); if (!string.IsNullOrEmpty(node.JSTIME) && !string.IsNullOrEmpty(node.KSTIME) && node.SL != 0) { TimeSpan cha = DateTime.Parse(node.KSTIME) - DateTime.Parse(node.JSTIME); if (cha.TotalMinutes > 0) { index2 = i; ispass = false; break; } else { sum += Convert.ToInt32(jldataGridView.Rows[i].Cells[3].Value); submodel.Add(node); } } } if (string.IsNullOrEmpty(sdzsltextBox.Text.Trim())) { sdzsltextBox.Text = sum.ToString(); model.SL = sum; } else { model.SL = Convert.ToInt32(sdzsltextBox.Text.Trim()); } model.MES_TM_ZFDCMX = submodel.ToArray(); for (int i = 0; i < submodel.Count; i++) { TimeSpan span = Convert.ToDateTime(model.KSTIME) - Convert.ToDateTime(submodel[i].KSTIME); if (span.TotalMinutes > 0) { ShowMeg("第" + (i + 1).ToString() + "开始时间小于抬头开始时间"); return; } span = Convert.ToDateTime(model.JSTIME) - Convert.ToDateTime(submodel[i].JSTIME); if (span.TotalMinutes < 0) { ShowMeg("第" + (i + 1).ToString() + "结束时间大于抬头结束时间"); return; } //if (model.KSTIME < submodel[i].KSTIME) //{ //} //model.KSTIME submodel[i].KSTIME } if (ispass) { MES_RETURN_UI res = ServicModel.PD_SCRW.ZX_CC(model, getToken()); if (res.TYPE.Equals("S")) { PrintInfoByTM(res.TM, res.GC, Convert.ToInt32(fsnumericUpDown1.Value), Rigth_Type.zhuxiancc, Print_Type.zfsd); if (block != null) { block(MES_PD_SCRW_LIST.RWBH); this.Close(); } } else { ShowMeg(res.MESSAGE); } } else { ShowMeg("第" + (index2 + 1).ToString() + "行开始时间大于结束时间请检查修改"); } }