public void GetTransferDetails(string TransferID) { long TRID = long.Parse(TransferID); BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient(); BrilliantWMS.WMSInbound.iInboundClient Inbound = new WMSInbound.iInboundClient(); CustomProfile profile = CustomProfile.GetProfile(); iUCCommonFilterClient objService = new iUCCommonFilterClient(); List <vGetUserProfileByUserID> UsersList = new List <vGetUserProfileByUserID>(); try { BrilliantWMS.WMSOutbound.tTransferHead trh = new WMSOutbound.tTransferHead(); //= new tTransferHead(); trh = Outbound.GetTransferHeadDetailByTransferID(TRID, profile.DBConnection._constr); lblWTWTransferNo.Text = trh.ID.ToString(); UCWTWTransferDate.Date = trh.TransferDate; fillUser(); ddlWTWTransferBy.SelectedIndex = ddlWTWTransferBy.Items.IndexOf(ddlWTWTransferBy.Items.FindByValue(trh.TransferBy.ToString())); ddlWTWStatus.DataSource = WMFillStatus(); ddlWTWStatus.DataBind(); ddlWTWStatus.SelectedIndex = ddlWTWStatus.Items.IndexOf(ddlWTWStatus.Items.FindByValue(trh.Status.ToString())); fillWarehouse(); ddlFWarehouse.SelectedIndex = ddlFWarehouse.Items.IndexOf(ddlFWarehouse.Items.FindByValue(trh.FromPosition.ToString())); List <BrilliantWMS.WMSInbound.mWarehouseMaster> ToWarehouseList = new List <WMSInbound.mWarehouseMaster>(); long UserID = profile.Personal.UserID; ToWarehouseList = Inbound.GetUserWarehouse(UserID, profile.DBConnection._constr).ToList(); ddlTWarehouse.DataSource = ToWarehouseList; ddlTWarehouse.DataBind(); ddlTWarehouse.SelectedIndex = ddlTWarehouse.Items.IndexOf(ddlTWarehouse.Items.FindByValue(trh.ToPosition.ToString())); WTWTRemark.Text = trh.Remark.ToString(); txtAirwayBill.Text = trh.AirwayBill.ToString(); txtShippingType.Text = trh.ShippingType.ToString(); UC_ShippingDate.Date = trh.ShippingDate; UCExpDeliveryDate.Date = trh.ExpDeliveryDate; txtTransporterName.Text = trh.TransporterName.ToString(); Grid1.DataSource = Outbound.GetTransferPartDetailByTransferID(TRID, long.Parse(trh.FromPosition.ToString()), Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr); Grid1.DataBind(); ScriptManager.RegisterStartupScript(this, this.GetType(), "changemodeRequest" + Session.SessionID, "changemode(true, 'divWTWTransferDetail');LoadingOff();", true); } catch { } finally { Outbound.Close(); objService.Close(); UsersList.Clear(); } }
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); }