public void DoSupplement(tinpsupplement supplement, List<tinpsupplementdtl> lstsupplementdtl) { try { dbInstance.BeginTransaction(); baseDal.DoInsert(supplement); string eventgroup = Function.GetGUID(); foreach (tinpsupplementdtl supplementdtl in lstsupplementdtl) { supplementDtlDal.DoInsert(supplementdtl); #region Update WIP wipDal.SaveOrUpdate(supplementdtl.customerid, supplementdtl.custorderno, supplementdtl.styleno, supplementdtl.color, supplementdtl.size, supplement.step, supplement.workgroup, Convert.ToInt16(supplementdtl.pairqty), supplementdtl.checktype); #endregion #region Update CustomerOrder History tinpcustorderhistory history = new tinpcustorderhistory(); history.customerid = supplementdtl.customerid; history.cartonno = ""; history.cartonqty = 0; history.custorderno = supplementdtl.custorderno; history.size = supplementdtl.size; history.styleno = supplementdtl.styleno; history.color = supplementdtl.color; history.eventgroup = eventgroup; history.eventname = "Supplement"; history.pairqty = supplementdtl.pairqty; history.refsysid = supplementdtl.supldtlsysid; history.remark = ""; history.eventtime = Function.GetCurrentTime(); history.eventuser = CurrentContextInfo.CurrentUser; history.ohsysid = Function.GetGUID(); history.shift = CurrentContextInfo.Shift; history.workgroup = CurrentContextInfo.WorkGroup; custOrderHistoryDal.DoInsert<tinpcustorderhistory>(history); #endregion } dbInstance.Commit(); } catch (Exception ex) { dbInstance.Rollback(); throw ex; } finally { dbInstance.CloseConnection(); } }
/// <summary> /// Deprecated Method for adding a new object to the tinpsupplement EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotinpsupplement(tinpsupplement tinpsupplement) { base.AddObject("tinpsupplement", tinpsupplement); }
/// <summary> /// Create a new tinpsupplement object. /// </summary> /// <param name="suplsysid">Initial value of the suplsysid property.</param> /// <param name="supplementno">Initial value of the supplementno property.</param> /// <param name="custorderno">Initial value of the custorderno property.</param> public static tinpsupplement Createtinpsupplement(global::System.String suplsysid, global::System.String supplementno, global::System.String custorderno) { tinpsupplement tinpsupplement = new tinpsupplement(); tinpsupplement.suplsysid = suplsysid; tinpsupplement.supplementno = supplementno; tinpsupplement.custorderno = custorderno; return tinpsupplement; }
private void DoSupplement() { wsINP.IwsINPClient client = new wsINP.IwsINPClient(); try { baseForm.SetCursor(); baseForm.ValidateData(this); if (!isExistOrder(((ValueInfo)this.cmbCustomer.SelectedItem).ValueField,this.txtCustOrderNo.Text)) { throw new Exception(UtilCulture.GetString("Msg.R01021", this.txtCustOrderNo.Text)); } tinpsupplement supplement = new tinpsupplement(); supplement.suplsysid = Function.GetGUID(); supplement.supplementno = this.txtSupplementNo.Text; supplement.customerid = ((ValueInfo)this.cmbCustomer.SelectedItem).ValueField; supplement.custorderno = this.txtCustOrderNo.Text; supplement.step = ((ValueInfo)this.cmbStep.SelectedItem).ValueField; supplement.workgroup = ((ValueInfo)this.cmbWorkGroup.SelectedItem).ValueField; supplement.factory = this.txtFactory.Text; supplement.supplementdate = Function.GetCurrentTime(); supplement.supplementuser = Function.GetCurrentUser(); supplement.lastmodifiedtime = Function.GetCurrentTime(); supplement.lastmodifieduser = Function.GetCurrentUser(); List<tinpsupplementdtl> lstsupplementdtl = new List<tinpsupplementdtl>(); foreach (UltraGridRow row in this.grdDetail.Rows) { if (row.Cells["styleno"].Value.ToString().Equals(string.Empty)) { throw new Exception(UtilCulture.GetString("Msg.R01020", UtilCulture.GetString("Label.R01026"))); } if (row.Cells["color"].Value.ToString().Equals(string.Empty)) { throw new Exception(UtilCulture.GetString("Msg.R01020", UtilCulture.GetString("Label.R01027"))); } if (row.Cells["size"].Value.ToString().Equals(string.Empty)) { throw new Exception(UtilCulture.GetString("Msg.R01020", UtilCulture.GetString("Label.R01028"))); } if (Convert.ToInt16(row.Cells["pairqty"].Value) == 0) { throw new Exception(UtilCulture.GetString("Msg.R01016", UtilCulture.GetString("Label.R02026"))); } tinpsupplementdtl supplementdtl = new tinpsupplementdtl(); supplementdtl.supldtlsysid = Function.GetGUID(); supplementdtl.suplsysid = supplement.suplsysid; supplementdtl.customerid = ((ValueInfo)this.cmbCustomer.SelectedItem).ValueField; supplementdtl.custorderno = supplement.custorderno; supplementdtl.styleno = row.Cells["styleno"].Value.ToString(); supplementdtl.color = row.Cells["color"].Value.ToString(); supplementdtl.size = row.Cells["size"].Value.ToString(); supplementdtl.checktype = row.Cells["checktype"].Value.ToString(); supplementdtl.pairqty = Convert.ToInt16(row.Cells["pairqty"].Value); supplementdtl.isreinspect = row.Cells["isreinspect"].Value.ToString(); lstsupplementdtl.Add(supplementdtl); } if (lstsupplementdtl.Count == 0) { throw new Exception(UtilCulture.GetString("Msg.R01019")); } client.DoSupplement(baseForm.CurrentContextInfo, supplement, lstsupplementdtl.ToArray<tinpsupplementdtl>()); 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); } }
public void DoSupplement(ContextInfo contextInfo, tinpsupplement supplement, List<tinpsupplementdtl> lstsupplementdtl) { contextInfo.Action = MES_ActionType.Insert; SupplementBll bll = new SupplementBll(contextInfo); bll.CallAccessControl(); bll.DoSupplement(supplement, lstsupplementdtl); GC.Collect(); }