private void DoRepair(bool closeFlag) { wsINP.IwsINPClient client = new wsINP.IwsINPClient(); try{ baseForm.SetCursor(); baseForm.ValidateData(this); if (this.numRepairQty.Value > Convert.ToInt16(this.txtPairQty.Text)) { throw new Exception(UtilCulture.GetString("Msg.R01014", UtilCulture.GetString("Label.R02026"), UtilCulture.GetString("Label.R02036"))); } tinprepairhis his = new tinprepairhis(); his.repsysid = Function.GetGUID(); his.workgroup = ((ValueInfo)this.cmbWorkGroup.SelectedItem).ValueField; his.step = ((ValueInfo)this.cmbStep.SelectedItem).ValueField; his.reptype = MES_RepairType.ToRepair.ToString(); his.customerid = this.ucmbCustOrderNo.SelectedRow.Cells["customerid"].Value.ToString(); his.custorderno = this.ucmbCustOrderNo.Value.ToString(); his.styleno = this.txtStyleNo.Text; his.color = this.txtColor.Text; his.size = this.txtSize.Text; his.checktype = this.ucmbCustOrderNo.SelectedRow.Cells["checktype"].Value.ToString(); his.isfirst = this.ckIsFirst.Checked ? MES_Misc.Y.ToString() : MES_Misc.N.ToString(); his.pairqty = this.numRepairQty.Value; his.claimtime = Function.GetCurrentTime(); his.claimuser = Function.GetCurrentUser(); List<tinprepairfail> lstreasoncode = new List<tinprepairfail>(); foreach (UltraGridRow row in this.grdDetail.Rows) { if (row.Cells["ck"].Value.ToString().Equals("Y")) { if (Convert.ToDecimal(row.Cells["pairqty"].Value)==0) { throw new Exception(UtilCulture.GetString("Msg.R01016", UtilCulture.GetString("Label.R02036"))); } tinprepairfail repairfail = new tinprepairfail(); repairfail.reasoncode = row.Cells["reasoncode"].Value.ToString(); repairfail.remark = row.Cells["remark"].Value.ToString(); repairfail.pairqty = Convert.ToDecimal(row.Cells["pairqty"].Value); lstreasoncode.Add(repairfail); } } if (this.numRepairQty.Value == 0) { throw new Exception(UtilCulture.GetString("Msg.R01016", UtilCulture.GetString("Label.R02036"))); } if (lstreasoncode.Count == 0) { throw new Exception(UtilCulture.GetString("Msg.R01015")); } client.DoInsertRepair(baseForm.CurrentContextInfo, his, lstreasoncode.ToArray<tinprepairfail>()); baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00002")); if (closeFlag) { this.Close(); } else { Clean(); } } catch (Exception ex) { baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ex.Message); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
/// <summary> /// Deprecated Method for adding a new object to the tinprepairfail EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotinprepairfail(tinprepairfail tinprepairfail) { base.AddObject("tinprepairfail", tinprepairfail); }
/// <summary> /// Create a new tinprepairfail object. /// </summary> /// <param name="repsysid">Initial value of the repsysid property.</param> /// <param name="reasoncode">Initial value of the reasoncode property.</param> public static tinprepairfail Createtinprepairfail(global::System.String repsysid, global::System.String reasoncode) { tinprepairfail tinprepairfail = new tinprepairfail(); tinprepairfail.repsysid = repsysid; tinprepairfail.reasoncode = reasoncode; return tinprepairfail; }
private void DoRepair() { wsINP.IwsINPClient client = new wsINP.IwsINPClient(); try { baseForm.SetCursor(); baseForm.ValidateData(this); if (((ValueInfo)this.cmbJointType.SelectedItem).ValueField != "") { if (((ValueInfo)this.cmbJointType.SelectedItem).ValueField.Equals("签名") && this.txtSignature.Text.Trim() == "") { throw new Exception(UtilCulture.GetString("Msg.R01020", UtilCulture.GetString("Label.R010763"))); } if (this.numFailedQty.Value > 0) { throw new Exception(UtilCulture.GetString("Msg.R01014", UtilCulture.GetString("Label.R01076"), "0")); } } if (this.numSuccessQty.Value == 0 && this.numFailedQty.Value == 0) { throw new Exception(UtilCulture.GetString("Msg.R01017", UtilCulture.GetString("Label.R01075"), UtilCulture.GetString("Label.R01076"))); } if ((this.numSuccessQty.Value + this.numFailedQty.Value) > RepairStock.curpairqty) { throw new Exception(UtilCulture.GetString("Msg.R01014", UtilCulture.GetString("Label.R01075") + "+" + UtilCulture.GetString("Label.R01076"), UtilCulture.GetString("Label.R01074"))); } tinprepairstock repairstock = new tinprepairstock(); repairstock.customerid = RepairStock.customerid; repairstock.custorderno = this.txtCustOrderNo.Text; repairstock.styleno = this.txtStyleNo.Text; repairstock.color = this.txtColor.Text; repairstock.size = this.txtSize.Text; repairstock.checktype = RepairStock.checktype; repairstock.ttlpairgoodqty = this.numSuccessQty.Value; repairstock.ttlbadqty = this.numFailedQty.Value; repairstock.step = ((ValueInfo)this.cmbToStep.SelectedItem).ValueField; repairstock.workgroup = ((ValueInfo)this.cmbWorkGroup.SelectedItem).ValueField; List<tinprepairfail> lstreasoncode = new List<tinprepairfail>(); foreach (UltraGridRow row in this.grdDetail.Rows) { if (row.Cells["ck"].Value.ToString().Equals("Y")) { if (Convert.ToDecimal(row.Cells["pairqty"].Value) == 0) { throw new Exception(UtilCulture.GetString("Msg.R01016", UtilCulture.GetString("Label.R010761"))); } tinprepairfail repairfail = new tinprepairfail(); repairfail.reasoncode = row.Cells["reasoncode"].Value.ToString(); repairfail.remark = row.Cells["remark"].Value.ToString(); repairfail.pairqty = Convert.ToDecimal(row.Cells["pairqty"].Value); lstreasoncode.Add(repairfail); } } client.DoRepairBack(baseForm.CurrentContextInfo, repairstock, lstreasoncode.ToArray<tinprepairfail>(), ((ValueInfo)this.cmbJointType.SelectedItem).ValueField,this.txtSignature.Text.Trim()); baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00002")); this.Close(); } catch (Exception ex) { baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ex.Message); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }