private void GetData(List<MESParameterInfo> lstParameters) { wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { baseForm.SetCursor(); // DataSet ds = client.GetWipRecords(baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()); DataSet ds = client.GetPOListByStep(fun, baseForm.CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()); this.grdQuery.SetDataBinding(ds.Tables[0], ""); this.ucStatusBar1.ShowText1(UtilCulture.GetString("Msg.R00006") + ": " + ds.Tables[0].Rows.Count.ToString()); } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
private string iniPermission() { wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { string function= client.GetFuncByUser( baseForm.CurrentContextInfo ); return function; } catch (Exception ex) { baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00122")); return null; } finally { baseForm.ResetCursor(); if (client.State == System.ServiceModel.CommunicationState.Opened) baseForm.CloseWCF(client); } }
private void grdQuery_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { //shou option window int i = this.grdQuery.ActiveRow.Index; string poid = this.grdQuery.Rows[i].Cells["poid"].Value.ToString().Trim(); string customerid = this.grdQuery.Rows[i].Cells["customerid"].Value.ToString().Trim(); string customer = this.grdQuery.Rows[i].Cells["customer"].Value.ToString().Trim(); string cartonno = this.grdQuery.Rows[i].Cells["cartonno"].Value.ToString().Trim(); string action = cmbAction.Text; string msg = "你是否要取消" + customer + "的" + poid + "订单的第" + cartonno + "箱的" + action + "?"; System.Windows.Forms.DialogResult res= baseForm.CreateMessageBox(Public_MessageBox.Question , MessageBoxButtons.YesNo , "请确认", msg); if (res == System.Windows.Forms.DialogResult.No) { return; } // frmOpenBox openWin = new frmOpenBox(poid, customerid, customerName); // openWin.Show(); wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { bool ds =false; if (action == "检品开箱") { ds = client.CancelOpen(customerid, cartonno, poid, baseForm.CurrentContextInfo.CurrentUser, baseForm.CurrentContextInfo); } if (action == "检品装箱") { ds = client.CancelMove(customerid, cartonno, poid, baseForm.CurrentContextInfo.CurrentUser, baseForm.CurrentContextInfo); } if (action == "只检品封箱") { ds = client.CancelPack(customerid, cartonno, poid, baseForm.CurrentContextInfo.CurrentUser, baseForm.CurrentContextInfo); } if (action == "X线开箱") { ds = client.CancelOpen(customerid, cartonno, poid, baseForm.CurrentContextInfo.CurrentUser, baseForm.CurrentContextInfo); } if (action == "全检封箱") { ds = client.CancelPack(customerid, cartonno, poid, baseForm.CurrentContextInfo.CurrentUser, baseForm.CurrentContextInfo); } if (action == "只X线封箱") { ds = client.CancelPack(customerid, cartonno, poid, baseForm.CurrentContextInfo.CurrentUser, baseForm.CurrentContextInfo); } if (ds) { baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, "消息提示", "成功取消"); } else { baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, "消息提示", "取消失败"); } RefreshGrid(); } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
private void butSave_Click(object sender, System.EventArgs e) { if (this.textBox2.Text.Trim().Length == 0) { baseForm.CreateMessageBox(Public_MessageBox.Warning, System.Windows.Forms.MessageBoxButtons.OK, "警告信息", "请先输入箱号"); return; } int cartonNo = int.Parse(textBox2.Text); ////201306 George --Begin if (cartonDt.Rows.Count <= 0) { // baseForm.CreateMessageBox(Public_MessageBox.Warning , MessageBoxButtons.OK, null, "没有输入数据"); // return ; DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Question, MessageBoxButtons.YesNo, null, "没有输入数据,你是否要装空箱?"); if (result == DialogResult.Yes) { //空箱装,但要输入密码验证 frmLineCheck frm = new frmLineCheck(); DialogResult res = frm.ShowDialog(); if (res == System.Windows.Forms.DialogResult.Cancel) { return; } else { ////装空箱 if (saveCarton(cartonNo + "")) { this.txtOpened.Text = (int.Parse(txtOpened.Text) + 1) + ""; baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, "保存成功!"); return; } else { return; } } } else { //空箱不装,返回 return; } } ////201306 George --End String checkresult = ""; #region check with original info wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { #region 构造当前箱 DataTable curentCarton = (from p in boxDt.AsEnumerable() where p.Field<string>("cartonNumber") == cartonNo.ToString() select p).CopyToDataTable(); curentCarton.TableName = "curentCarton"; curentCarton.Columns.Add(new DataColumn("poid", typeof(System.String))); curentCarton.Columns.Add(new DataColumn("customerid", typeof(System.String))); foreach (DataRow item in curentCarton.Rows) { item["poid"] = poID; item["customerid"] = customerid; } #endregion //check 条件 checkresult = client.PackBoxCheckGroup(curentCarton); if (checkresult == "OK") { List<string> status = (from p in cartonDt.AsEnumerable() where p.Field<string>("cartonNumber") == cartonNo.ToString() select p.Field<string>("valid")).ToList<string>(); if (status[0] == "否") { #region 不满箱 string[] butText = { "直接封箱", "暂时保存" }; DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Question, MessageBoxButtons.YesNo, null, "本箱不满箱,是否要封箱?", butText); if (result == DialogResult.No) { this.saveTempInfo(curentCarton); #region 修改为已经保存 for (int i = 0; i < cartonDt.Rows.Count; i++) { if (cartonDt.Rows[i]["cartonNumber"].ToString() == textBox2.Text) { cartonDt.Rows[i]["status"] = "已保存(暂存线上)"; break; } } #endregion } else { ////201307 George --Begin // frmLineCheck frm = new frmLineCheck(); // DialogResult res = frm.ShowDialog(); // if (res == System.Windows.Forms.DialogResult.Cancel) // { // return; // } ////201307 George --End saveCarton(curentCarton); #region 修改为已经保存 for (int i = 0; i < cartonDt.Rows.Count; i++) { if (cartonDt.Rows[i]["cartonNumber"].ToString() == textBox2.Text) { cartonDt.Rows[i]["status"] = "已保存"; break; } } ////201306 George --begin this.txtOpened.Text = (int.Parse(txtOpened.Text) + 1) + ""; ////201306 George --end } #endregion #endregion } else { #region 满箱 saveCarton(curentCarton); #region 修改为已经保存 for (int i = 0; i < cartonDt.Rows.Count; i++) { if (cartonDt.Rows[i]["cartonNumber"].ToString() == textBox2.Text) { cartonDt.Rows[i]["status"] = "已保存"; break; } } ////201306 George --begin this.txtOpened.Text = (int.Parse(txtOpened.Text) + 1) + ""; ////201306 George --end #endregion } #endregion } else { baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, checkresult); } } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } #endregion }
private void butSaveRow_Click(object sender, EventArgs e) { if (textBox2.Text.Length == 0 || textType.Text.Length == 0 || textSize.Text.Length == 0 || textPairQty.Text.Length == 0 || textColor.Text.Length == 0) { baseForm.CreateMessageBox(Public_MessageBox.Error, System.Windows.Forms.MessageBoxButtons.OK, "输入错误", "款号,颜色,尺码,数量必须输入"); } try { #region create table if it's null if (cartonDt == null) { cartonDt = new DataTable("carton"); cartonDt.TableName = "carton"; cartonDt.Columns.Add(new DataColumn("cartonNumber", typeof(System.String))); cartonDt.Columns.Add(new DataColumn("qty", typeof(System.Int32))); cartonDt.Columns.Add(new DataColumn("qty2", typeof(System.Int32))); cartonDt.Columns.Add(new DataColumn("valid", typeof(System.Int32))); cartonDt.Columns.Add(new DataColumn("status", typeof(System.String))); } if (boxDt == null) { boxDt = new DataTable("box"); boxDt.TableName = "box"; boxDt.Columns.Add(new DataColumn("cartonNumber", typeof(System.String))); boxDt.Columns.Add(new DataColumn("type", typeof(System.String))); boxDt.Columns.Add(new DataColumn("color", typeof(System.String))); boxDt.Columns.Add(new DataColumn("size", typeof(System.String))); boxDt.Columns.Add(new DataColumn("qty", typeof(System.Int32))); boxDt.Columns.Add(new DataColumn("qty2", typeof(System.Int32))); } #endregion #region check befor save #region 构造当前箱 DataTable checkCarton = new DataTable("box"); checkCarton.TableName = "box"; checkCarton.Columns.Add(new DataColumn("cartonNumber", typeof(System.String))); checkCarton.Columns.Add(new DataColumn("type", typeof(System.String))); checkCarton.Columns.Add(new DataColumn("color", typeof(System.String))); checkCarton.Columns.Add(new DataColumn("size", typeof(System.String))); checkCarton.Columns.Add(new DataColumn("qty", typeof(System.Int32))); checkCarton.Columns.Add(new DataColumn("qty2", typeof(System.Int32))); checkCarton.Columns.Add(new DataColumn("poid", typeof(System.String))); checkCarton.Columns.Add(new DataColumn("customerid", typeof(System.String))); DataRow dr3 = checkCarton.NewRow(); dr3["cartonNumber"] = textBox2.Text; dr3["type"] = textType.Text; dr3["color"] = textColor.Text; dr3["size"] = textSize.Text; dr3["qty"] = int.Parse(textPairQty.Text); ; dr3["qty2"] = int.Parse(textPairQty.Text); dr3["poid"] = poID; dr3["customerid"] = customerid; checkCarton.Rows.Add(dr3); #endregion wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { //check 条件 string checkresult = client.PackBoxCheckGroup(checkCarton); if (checkresult != "OK") { //检查条件不通过 baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, checkresult); return; } } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } #endregion #region 获得开箱信息 int openQtyGroup = 0; int openQtyBox = 0; string cartonNumber = textBox2.Text; DataSet rs = getOpenDetail(cartonNumber); if (rs != null) { var resultGroup1 = (from p in rs.Tables[0].AsEnumerable() where p.Field<string>("styleno") == textType.Text && p.Field<string>("color") == textColor.Text && p.Field<string>("size") == textSize.Text select p).ToList(); if (resultGroup1.Count != 0) { DataRow currentGroup = resultGroup1[0]; openQtyGroup = int.Parse(currentGroup["pairqty"].ToString()); } var openQtyOfCarton = (from p in rs.Tables[0].AsEnumerable() // where p.Field<string>("styleno") == textType.Text // && p.Field<string>("color") == textColor.Text // && p.Field<string>("size") == textSize.Text select p.Field<Decimal>("pairqty")).Sum(); if (openQtyOfCarton != 0) { openQtyBox = (int)openQtyOfCarton; } } #endregion #region 封箱与开箱数量不符 if (openQtyBox == 0) //没有开箱 { baseForm.CreateMessageBox(Public_MessageBox.Error, System.Windows.Forms.MessageBoxButtons.OK, "提示信息", "没有开箱数据 "); return; } else { //已经开箱,但与开箱数量不符 if (openQtyGroup != int.Parse(textPairQty.Text)) { DialogResult resultDlg = baseForm.CreateMessageBox(Public_MessageBox.Question, System.Windows.Forms.MessageBoxButtons.YesNo, "提示信息", "输入的数据与开箱数据不一致,是否继续?"); if (resultDlg == DialogResult.No) { return; //放弃本次输入 } ////201306 George --begin else { frmLineCheck frm = new frmLineCheck(); DialogResult res = frm.ShowDialog(); if (res == System.Windows.Forms.DialogResult.Cancel) { return; } } ////201306 George --end } } #endregion #region WIP 不够Move int wip = getWIPQty(textType.Text, textColor.Text, textSize.Text); if (wip < int.Parse(textPairQty.Text)) { baseForm.CreateMessageBox(Public_MessageBox.Error, System.Windows.Forms.MessageBoxButtons.OK, "提示信息", "线上没有这么多制品,你输入的数量不对"); return; } #endregion #region if carton don't exists, insert it var result = (from p in cartonDt.AsEnumerable() where p.Field<string>("cartonNumber") == textBox2.Text select p).ToList(); if (result == null || result.Count == 0) { //put data to new table DataRow dr = cartonDt.NewRow(); dr["cartonNumber"] = textBox2.Text; dr["qty"] = openQtyBox; dr["qty2"] = 0; dr["valid"] = ""; dr["status"] = "未保存"; cartonDt.Rows.Add(dr); } else { //如已经保存到数据库,不可以再修改////////// string status = result[0]["status"].ToString(); if (status == "已保存") { baseForm.CreateMessageBox(Public_MessageBox.Warning, MessageBoxButtons.OK, "警告信息", "已经保存到数据库,不可以修改!"); return; } //////////////////////////////////////////// } #endregion #region if group exists, update qty, else insert var resultGroup = (from p in boxDt.AsEnumerable() where p.Field<string>("cartonNumber") == textBox2.Text && p.Field<string>("type") == textType.Text && p.Field<string>("color") == textColor.Text && p.Field<string>("size") == textSize.Text select p); if (resultGroup.ToList().Count > 0) { foreach (DataRow item in resultGroup) { item["qty2"] = int.Parse(textPairQty.Text); } } else { DataRow dr2 = boxDt.NewRow(); dr2["cartonNumber"] = textBox2.Text; dr2["type"] = textType.Text; dr2["color"] = textColor.Text; dr2["size"] = textSize.Text; dr2["qty"] = openQtyGroup; dr2["qty2"] = int.Parse(textPairQty.Text); boxDt.Rows.Add(dr2); } #endregion #region update shoes qty of this carton var curentCarton = (from p in cartonDt.AsEnumerable() where p.Field<string>("cartonNumber") == textBox2.Text select p).ToList(); var qtyOfCarton = (from p in boxDt.AsEnumerable() where p.Field<string>("cartonNumber") == textBox2.Text select p.Field<Int32>("qty2")).Sum(); DataRow currentCarton = curentCarton[0]; currentCarton["qty2"] = qtyOfCarton; currentCarton["status"] = "未保存"; if (qtyOfCarton == openQtyBox) { currentCarton["valid"] = "是"; } else { currentCarton["valid"] = "否"; } #endregion #region bind data try { this.ultraGrid1.SetDataBinding(ds, ""); } catch (Exception ex) { ;// MicroMESMsgBox.ShowError(ExceptionParser.Parse(ex)); } #endregion #region 展开当前箱,闭合其他箱 foreach (UltraGridRow row in this.ultraGrid1.Rows) { if (null != row.ChildBands) { string carton1 = row.GetCellValue("cartonNumber").ToString(); if (carton1 == textBox2.Text) { row.Activate(); row.ExpandAll(); } else { row.CollapseAll(); } } } #endregion System.Windows.Forms.ToolTip toolTip2 = new System.Windows.Forms.ToolTip(); toolTip2.IsBalloon = true; toolTip2.UseAnimation = true; toolTip2.UseFading = true; toolTip2.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info; toolTip2.SetToolTip(butSave, "如果是本箱数据已经输入完成,请单击这里保存"); toolTip2.Show("如果是本箱数据已经输入完成,请单击这里保存", butSave, 1000); toolTip.SetToolTip(panelType, "如果本箱还没完成,请继续选择款号"); toolTip.Show("如果本箱还没完成,请继续选择款号", panelType, 2000); } catch (Exception ex) { return; } finally { ; } }
//201306 George --End private void updateCarton(DataTable curentCarton) { string trayID = textBox1.Text; wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { client.OpenBoxUpdateCarton(curentCarton, trayID, baseForm.CurrentContextInfo, this.customerid, textBox2.Text, poID); } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
private void saveTempInfo(DataTable curentCarton) { wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { client.lineWarehouseSave(curentCarton, baseForm.CurrentContextInfo); } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
//201306 George --Begin //save dummy carton private bool saveCarton(string curentCartonNumber) { wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { //check int checkResult = client.canSaveEnptycarton(customerid, poID, curentCartonNumber, "Packing", currStep, "", baseForm.CurrentContextInfo); if (checkResult == 0) { bool saved = client.PackBoxSaveDummyCarton(customerid, poID, curentCartonNumber, baseForm.CurrentContextInfo); if (saved) { return true; } else { return false; } } else { if (checkResult == 1) { baseForm.CreateMessageBox(Public_MessageBox.Warning, System.Windows.Forms.MessageBoxButtons.OK, "警告信息", "组上还有鞋子,不能装空箱"); } if (checkResult == 2) { baseForm.CreateMessageBox(Public_MessageBox.Warning, System.Windows.Forms.MessageBoxButtons.OK, "警告信息", "该箱已经装箱或封箱"); } if (checkResult == 3) { baseForm.CreateMessageBox(Public_MessageBox.Warning, System.Windows.Forms.MessageBoxButtons.OK, "警告信息", " 如果是检品+X线,请检查该箱是否已经装箱;如果仅X线,请检查是否开箱。)"); } return false; } } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); return false; } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
private void saveCarton(DataTable curentCarton) { string trayID = textBox1.Text; wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { client.PackBoxSaveCarton(curentCarton, trayID, baseForm.CurrentContextInfo); } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
private int getWIPQty(string style, string color, string size) { int wip = -1; wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { wip = client.getWIPByPO(customerid, poID, style, color, size, baseForm.CurrentContextInfo.WorkGroup, "Pack", currStep, baseForm.CurrentContextInfo); return wip; } catch (Exception ex) { return -1; throw ex; } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
private void GetPOColorAndType() { wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { colour = client.GetColorListByPO(poID, baseForm.CurrentContextInfo); type = client.GetTypeListByPO(poID, baseForm.CurrentContextInfo); size = client.GetSizeListByPO(poID, baseForm.CurrentContextInfo); } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
private DataSet getOpenDetail(string carton) { wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { DataSet res = client.GetOpenBox(this.customerid, this.poID, carton, "Pack", currStep, baseForm.CurrentContextInfo); if (res.Tables[0].Rows.Count > 0) { // baseForm.CreateMessageBox(Public_MessageBox.Information, System.Windows.Forms.MessageBoxButtons.OK, "信息", "本箱套装,可按‘保存本箱’直接保存"); return res; } else { baseForm.CreateMessageBox(Public_MessageBox.Information, System.Windows.Forms.MessageBoxButtons.OK, "信息", "没有开箱信息。"); return null; } } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); return null; } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
private DataSet getLineWarehouse(string carton) { wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { DataSet res = client.getLineWarehouse(this.customerid, this.poID, carton, baseForm.CurrentContextInfo.WorkGroup, baseForm.CurrentContextInfo); if (res.Tables[0].Rows.Count > 0) { baseForm.CreateMessageBox(Public_MessageBox.Information, System.Windows.Forms.MessageBoxButtons.OK, "信息", "本箱暂存在线上,系统将显示上次输入的数据,请按实际情况修改"); return res; } return null; } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); return null; } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
private bool deleteCarton(string carton) { wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { bool res = client.isShipped(this.customerid, this.poID, carton, baseForm.CurrentContextInfo); if (res) { baseForm.CreateMessageBox(Public_MessageBox.Information, System.Windows.Forms.MessageBoxButtons.OK, "警告信息", "该箱不可以删除,已经发货了"); return false; } else { bool res2 = client.DeleteBox(this.customerid, carton, this.poID, baseForm.CurrentContextInfo.CurrentUser, baseForm.CurrentContextInfo); return res2; } } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); return false; } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
private void butSave_Click(object sender, System.EventArgs e) { if (this.textBox2.Text.Trim().Length == 0) { baseForm.CreateMessageBox(Public_MessageBox.Warning, System.Windows.Forms.MessageBoxButtons.OK, "警告信息", "请先输入箱号"); return; } int cartonNo = int.Parse(textBox2.Text); String checkresult = ""; #region check with original info wsPAD.IwsPADClient client = new wsPAD.IwsPADClient(); try { #region 构造当前箱 DataTable curentCarton = (from p in boxDt.AsEnumerable() where p.Field<string>("cartonNumber") == textBox2.Text select p).CopyToDataTable(); curentCarton.TableName = "curentCarton"; curentCarton.Columns.Add(new DataColumn("poid", typeof(System.String))); curentCarton.Columns.Add(new DataColumn("customerid", typeof(System.String))); foreach (DataRow item in curentCarton.Rows) { item["poid"] = poID; item["customerid"] = customerid; } #endregion //check 条件 checkresult = client.OpenBoxCheckGroup(curentCarton); if (checkresult == "OK") { saveCarton(curentCarton); #region 修改为已经保存 for (int i = 0; i < cartonDt.Rows.Count; i++) { if (cartonDt.Rows[i]["cartonNumber"].ToString() == textBox2.Text) { cartonDt.Rows[i]["status"] = "已保存"; break; } } this.txtOpened.Text = (int.Parse(txtOpened.Text) + 1) + ""; #endregion } else { #region 异常处理 //大货入库不存在的箱 if (checkresult == "NoCarton") { baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, "大货入库数据中不存在该箱"); return; } //已经装箱/封箱,不可以再修改 if (checkresult == "boxing") { baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, "该箱已装箱,不可修改"); return; } //已经开箱,且本次与原箱信息不符 if (checkresult.StartsWith("Opened") && ((checkresult.IndexOf("NOGroup") > 1 || checkresult.IndexOf("groupMiss|NOGroup") > 1))) { DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Question, MessageBoxButtons.OK, null, "已经开箱,且本次输入与原箱信息不符\r\n 请放弃本次修改"); return; } // 已经开箱(但没有封箱),可以修改 if (checkresult == "Opened") { DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Warning, MessageBoxButtons.OK, null, "该箱已经开过箱!"); /* DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Question, MessageBoxButtons.YesNo, null, "该箱已经开过箱,但尚未装箱,你可以修改数据。\r\n选择“是”将修改上次的数据,“否”将放弃修改"); if (result == DialogResult.No) { return; } else { //修改已经开箱的数据 updateCarton(curentCarton); //UI for (int i = 0; i < cartonDt.Rows.Count; i++) { if (cartonDt.Rows[i]["cartonNumber"].ToString() == textBox2.Text) { cartonDt.Rows[i]["status"] = "已保存"; break; } } } return;*/ } //与原箱信息不符 if (checkresult.IndexOf("groupMiss") > 0 || checkresult.IndexOf("NOGroup") > 0) { DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Warning, MessageBoxButtons.OK, null, "输入数据与预录单信息不符,如果你输入的数据和实物相符,请联系修改预录单数据后重新输入本箱"); /* DialogResult result = baseForm.CreateMessageBox(Public_MessageBox.Question, MessageBoxButtons.YesNo, null, "与原箱信息不符,选择'是'将本箱暂存线上,请相关人员修改后再重新保存;\r\n选择'否'将返回,请修改数据后保存"); if (result == DialogResult.No) { return; } else { //暂存线上 bool saveRes= saveTempInfo(curentCarton); if (saveRes) { //UI for (int i = 0; i < cartonDt.Rows.Count; i++) { if (cartonDt.Rows[i]["cartonNumber"].ToString() == textBox2.Text) { cartonDt.Rows[i]["status"] = "已保存"; break; } } } }*/ } #endregion } } catch (Exception ex) { MESMsgBox.ShowError(ExceptionParser.Parse(ex)); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } #endregion }