public static long WMSaveTransferHead(object objTRHead) { long result = 0; int RSLT = 0; long TRID = 0; BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient(); try { CustomProfile profile = CustomProfile.GetProfile(); BrilliantWMS.WMSOutbound.tTransferHead trH = new WMSOutbound.tTransferHead(); Dictionary <string, object> d = new Dictionary <string, object>(); d = (Dictionary <string, object>)objTRHead; if (HttpContext.Current.Session["TRID"] != null) { if (HttpContext.Current.Session["TRID"].ToString() == "0") { trH.CreatedBy = profile.Personal.UserID; trH.CreationDate = DateTime.Now; } else { trH.ID = Convert.ToInt64(HttpContext.Current.Session["TRID"].ToString()); trH.Modifiedby = profile.Personal.UserID; trH.ModiedDate = DateTime.Now; } trH.Type = 2; trH.TransferDate = Convert.ToDateTime(d["TransferDate"]); trH.FromPosition = Convert.ToInt64(d["FromPosition"]); trH.ToPosition = Convert.ToInt64(d["ToPosition"]); trH.TransferBy = Convert.ToInt64(d["TransferBy"]); trH.Status = Convert.ToInt64(d["Status"]); trH.Remark = d["Remark"].ToString(); trH.CompanyID = profile.Personal.CompanyID; trH.AirwayBill = d["AirwayBill"].ToString(); trH.ShippingType = d["ShippingType"].ToString(); trH.TransporterName = d["TransporterName"].ToString(); trH.ShippingDate = Convert.ToDateTime(d["ShippingDate"]); trH.ExpDeliveryDate = Convert.ToDateTime(d["ExpDeliveryDate"]); trH.ObjectName = "Transfer"; TRID = Outbound.SaveIntotTransferHead(trH, profile.DBConnection._constr); if (TRID > 0) { RSLT = Outbound.FinalSaveTRDetail(HttpContext.Current.Session.SessionID, ObjectName, TRID, profile.Personal.UserID.ToString(), Convert.ToInt16(trH.Status), 0, profile.DBConnection._constr); if (RSLT == 1 || RSLT == 2) { result = TRID; } //"Request saved successfully"; else if (RSLT == 3) { result = -3; } } } } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, "WToWTransferDetail.aspx", "WMSaveRequestHead"); result = 0; // "Some error occurred"; } finally { Outbound.Close(); } return(result); }