/// <summary> /// Create a new tinpshipping object. /// </summary> /// <param name="shippingsysid">Initial value of the shippingsysid property.</param> public static tinpshipping Createtinpshipping(global::System.String shippingsysid) { tinpshipping tinpshipping = new tinpshipping(); tinpshipping.shippingsysid = shippingsysid; return tinpshipping; }
/// <summary> /// Deprecated Method for adding a new object to the tinpshipping EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTotinpshipping(tinpshipping tinpshipping) { base.AddObject("tinpshipping", tinpshipping); }
public void DoShipping(tinpshipping shipping, List<tinpshippingdtlctn> lstshippingdtlctn, tinpshippingplan shippingplan, bool isDoShipping) { try { dbInstance.BeginTransaction(); List<MESParameterInfo> lstParams = new List<MESParameterInfo>() { new MESParameterInfo(){ParamName="shippingsysid",ParamValue=shipping.shippingsysid} }; List<tinpshippingdtlctn> lstctn = shippingDtlCtnDal.GetSelectedObjects<tinpshippingdtlctn>(lstParams); foreach (tinpshippingdtlctn shippingdtlctn in lstctn) { packingRecDtlDal.UpdateIsShipped(shippingdtlctn.customerid,shippingdtlctn.custorderno, shippingdtlctn.cartonno, Public_Flag.N.ToString()); } shippingDtlCtnDal.DoDelete<tinpshippingdtlctn>(lstParams); shippingDtlDal.DoUpdateStatusByShippingSysId(shipping.shippingsysid, isDoShipping ? MES_ShippingStatus.Shipped.ToString() : MES_ShippingStatus.Created.ToString()); List<MESParameterInfo> lstPlanParams = new List<MESParameterInfo>() { new MESParameterInfo(){ParamName="shippingplanno",ParamValue=shippingplan.shippingplanno} }; List<tinpshippingplan> lstShippingplan = shippingPlanDal.GetSelectedObjects<tinpshippingplan>(lstPlanParams); if (lstShippingplan.Count > 0) { shippingPlanDal.DoUpdate<tinpshippingplan>(shippingplan); } else { shippingPlanDal.DoInsert<tinpshippingplan>(shippingplan); } List<tinpshipping> lstShipping = baseDal.GetSelectedObjects<tinpshipping>(lstParams); if (lstShipping.Count > 0) { tinpshipping shippingmdl = lstShipping[0]; shippingmdl.packingboxno = shipping.packingboxno; shippingmdl.blno = shipping.blno; shippingmdl.containerno = shipping.containerno; shippingmdl.loadingtype = shipping.loadingtype; //shippingmdl.contractno = shipping.contractno; shippingmdl.shippingstatus = isDoShipping ? MES_ShippingStatus.Shipped.ToString() : MES_ShippingStatus.Created.ToString(); shippingmdl.lastmodifeduser = CurrentContextInfo.CurrentUser; shippingmdl.lastmodifiedtime = Function.GetCurrentTime(); if (isDoShipping) { shippingmdl.shippeddate = Function.GetCurrentTime(); } baseDal.DoUpdate<tinpshipping>(shippingmdl); } else { shipping.shippingstatus = isDoShipping ? MES_ShippingStatus.Shipped.ToString() : MES_ShippingStatus.Created.ToString(); shipping.lastmodifeduser = CurrentContextInfo.CurrentUser; shipping.lastmodifiedtime = Function.GetCurrentTime(); shipping.createduser = CurrentContextInfo.CurrentUser; shipping.createdtime = Function.GetCurrentTime(); if (isDoShipping) { shipping.shippeddate = Function.GetCurrentTime(); } baseDal.DoInsert<tinpshipping>(shipping); } string eventgroup = Function.GetGUID(); List<tinpreceivingctndtl> lstReceivingRec = new List<tinpreceivingctndtl>(); foreach (tinpshippingdtlctn shippingdtlctn in lstshippingdtlctn) { shippingDtlCtnDal.DoInsert<tinpshippingdtlctn>(shippingdtlctn); packingRecDtlDal.UpdateIsShipped(shippingdtlctn.customerid,shippingdtlctn.custorderno, shippingdtlctn.cartonno,Public_Flag.Y.ToString()); if (isDoShipping) { List<MESParameterInfo> lstRecParams = new List<MESParameterInfo>() { new MESParameterInfo(){ParamName="customerid",ParamValue=shippingdtlctn.customerid}, new MESParameterInfo(){ParamName="custorderno",ParamValue=shippingdtlctn.custorderno}, new MESParameterInfo(){ParamName="cartonno",ParamValue=shippingdtlctn.cartonno} }; List<tinpreceivingctndtl> lstRec = receivingCtnDtlDal.GetSelectedObjects<tinpreceivingctndtl>(lstRecParams); foreach (tinpreceivingctndtl rec in lstRec) { rec.cartonstatus = MES_CartonStatus.Finished.ToString(); rec.cartonlocation = MES_CartonLocation.Shipped.ToString(); lstReceivingRec.Add(rec); //receivingCtnDtlDal.DoUpdate(rec); } } #region Update CustomerOrder History tinpcustorderhistory history = new tinpcustorderhistory(); history.customerid = shippingdtlctn.customerid; history.cartonno = shippingdtlctn.cartonno; history.cartonqty = 0; history.custorderno = shippingdtlctn.custorderno; history.size = ""; history.styleno = ""; history.color = ""; history.eventgroup = eventgroup; ; history.eventname = "Shipping"; history.pairqty = 0; history.refsysid = shipping.shippingsysid; 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 } foreach (tinpreceivingctndtl rec in lstReceivingRec) { receivingCtnDtlDal.DoUpdate(rec); } dbInstance.Commit(); } catch (Exception ex) { dbInstance.Rollback(); throw ex; } finally { dbInstance.CloseConnection(); } }
private void DoShipping(bool isDoShipping) { wsINP.IwsINPClient client = new wsINP.IwsINPClient(); try { baseForm.SetCursor(); baseForm.ValidateData(this); List<tinpshippingdtlctn> lstshippingdtlctn = new List<tinpshippingdtlctn>(); foreach (string key in ht.Keys) { DataTable dt = ht[key] as DataTable; int ctnqty = 0; foreach (DataRow row in dt.Rows) { if (row["ck"].ToString().Equals("Y")) { tinpshippingdtlctn shippingdtlctn = new tinpshippingdtlctn(); shippingdtlctn.shippingsysid = ShipingSysId; shippingdtlctn.customerid = row["customerid"].ToString(); shippingdtlctn.custorderno = key; shippingdtlctn.cartonno = row["cartonno"].ToString(); shippingdtlctn.pairqty = Convert.ToInt16(row["pairqty"].ToString()); lstshippingdtlctn.Add(shippingdtlctn); ctnqty++; } } if (ctnqty > getPlanQty(key) || (isDoShipping && ctnqty != getPlanQty(key))) { throw new Exception(UtilCulture.GetString("Msg.R01024")); } } tinpshipping shipping = new tinpshipping(); shipping.shippingsysid = ShipingSysId; shipping.packingboxno = this.txtPackingBoxNo.Text; shipping.shippingno = this.txtShipNo.Text; shipping.containerno = this.txtContainerNo.Text; shipping.blno = this.txtBlNo.Text; //shipping.contractno = this.txtContractNo.Text; if (this.cmbLoadingType.SelectedItem != null) { shipping.loadingtype = ((ValueInfo)this.cmbLoadingType.SelectedItem).ValueField; } tinpshippingplan shippingplan = new tinpshippingplan(); shippingplan.shippingplanno = ((ValueInfo)this.cmbShippingPlanNo.SelectedItem).DisplayField; shippingplan.loadingdate = Convert.ToDateTime(this.dtLoadingDt.Value); shippingplan.boxqty = this.txtBoxQty.Text; shippingplan.deliverybill = this.txtBlNo.Text; shippingplan.inshipno = this.txtInShipNo.Text; shippingplan.commissionedqty = Convert.ToInt16(this.numCommissionedQty.Value); shippingplan.commissionedvolume = this.numCommissionedVolume.Value; shippingplan.commissionedweight = this.numCommissionedWeight.Value; shippingplan.startport = this.txtStartPort.Text; shippingplan.destinationport = this.txtDestinationPort.Text; shippingplan.unloadport = this.txtUnloadPort.Text; shippingplan.voyage = this.txtVoyage.Text; client.DoShipping(baseForm.CurrentContextInfo, shipping, lstshippingdtlctn.ToArray<tinpshippingdtlctn>(),shippingplan, isDoShipping); baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00028")); this.Close(); } catch (Exception ex) { baseForm.CreateMessageBox(Public_MessageBox.Error, MessageBoxButtons.OK, null, ex.Message); } finally { baseForm.ResetCursor(); baseForm.CloseWCF(client); } }
public void DoShipping(ContextInfo contextInfo, tinpshipping shipping, List<tinpshippingdtlctn> lstshippingdtlctn, tinpshippingplan shippingplan, bool isDoShipping) { contextInfo.Action = MES_ActionType.Insert; ShippingBll bll = new ShippingBll(contextInfo); bll.CallAccessControl(); bll.DoShipping(shipping, lstshippingdtlctn,shippingplan, isDoShipping); GC.Collect(); }