public void FillUserList() { iUCCommonFilterClient objService = new iUCCommonFilterClient(); List <vGetUserProfileByUserID> UsersList = new List <vGetUserProfileByUserID>(); try { CustomProfile profile = CustomProfile.GetProfile(); UsersList = objService.GetUserListBySiteID(Convert.ToInt64(hdnSiteID.Value), profile.DBConnection._constr).ToList(); UsersList = UsersList.Distinct().ToList(); vGetUserProfileByUserID select = new vGetUserProfileByUserID() { userID = 0, userName = "******" }; UsersList.Insert(0, select); ddlReceivedBy.DataSource = null; ddlReceivedBy.DataBind(); ddlReceivedBy.DataSource = UsersList; ddlReceivedBy.DataBind(); ddlReceivedBy.SelectedIndex = ddlReceivedBy.Items.IndexOf(ddlReceivedBy.Items.FindByValue(profile.Personal.UserID.ToString())); } catch { } finally { objService.Close(); } }
public static string WMSaveRequestHead(object objAdr, string State) { string result = ""; CustomProfile profile = CustomProfile.GetProfile(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); tAddress Adrs = new tAddress(); tContactPersonDetail Con = new tContactPersonDetail(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objAdr; Adrs.AddressLine1 = dictionary["AddressLine1"].ToString(); Adrs.ID = Convert.ToInt64(HttpContext.Current.Session["ConID"].ToString()); Adrs.LastModifiedBy = profile.Personal.UserID.ToString(); Adrs.LastModifiedDate = DateTime.Now; Adrs.City = ""; UCCommonFilter.EditAddress(Adrs, profile.DBConnection._constr); Con.Name = dictionary["Name"].ToString(); Con.EmailID = dictionary["EmilID"].ToString(); Con.MobileNo = dictionary["MobileNo"].ToString(); long AdrsID = Convert.ToInt64(HttpContext.Current.Session["ConID"].ToString()); UCCommonFilter.EditLocation(Con, AdrsID, profile.DBConnection._constr); result = "Location saved successfully"; } catch { result = "Some error occurred"; } finally { UCCommonFilter.Close(); } return(result); }
protected void GetContactDetailByContactID() { CustomProfile profile = CustomProfile.GetProfile(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); try { tContactPersonDetail conper = new tContactPersonDetail(); conper = UCCommonFilter.GetContactPersonDetailsByID(long.Parse(hdnConID.Value), profile.DBConnection._constr); if (conper.Name != null) { txtName.Text = conper.Name.ToString(); } if (conper.EmailID != null) { txtEmail.Text = conper.EmailID.ToString(); } if (conper.MobileNo != null) { txtMobileNo.Text = conper.MobileNo.ToString(); } } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "AddEditSearchContact", "GetContactDetailByContactID"); } finally { UCCommonFilter.Close(); } }
protected void GetContactDetailByContactID() { CustomProfile profile = CustomProfile.GetProfile(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); try { tAddress conper = new tAddress(); conper = UCCommonFilter.GetAddressDetailsByID(long.Parse(hdnConID.Value), profile.DBConnection._constr); VW_GetUserLocation LocDetail = UCCommonFilter.GetLocationDetailsByID(long.Parse(hdnConID.Value), profile.DBConnection._constr); btnSave.Visible = true; if (sessionID == null) { sessionID = Session.SessionID; } if (LocDetail.AddressLine1 != null) { txtAddress.Text = LocDetail.AddressLine1.ToString(); } if (LocDetail.LocationCode != null) { txtLocationCode.Text = LocDetail.LocationCode.ToString(); } txtLocationCode.Enabled = false; if (LocDetail.LocationName != null) { txtLocationName.Text = LocDetail.LocationName.ToString(); } txtLocationName.Enabled = false; if (LocDetail.Name != null) { txtContactName.Text = LocDetail.Name.ToString(); } if (LocDetail.MobileNo != null) { txtContactNo.Text = LocDetail.MobileNo.ToString(); } if (LocDetail.EmailID != null) { txtEmailID.Text = LocDetail.EmailID.ToString(); } // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry1" + sessionID, "setCountry('India','Maharashtra','0','0');", true); // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry1" + sessionID, "setCountry('" + conper.County + "','" + conper.State + "','0','0');", true); // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry" + sessionID, "setCountry('" + conper.County + "','" + conper.State + "','" + conper.Zone + "','" + conper.SubZone + "');", true); } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "AddEditSearchAddress", "GetContactDetailByContactID"); } finally { UCCommonFilter.Close(); } }
public static string WMSaveRequestHead(object objAdr, string State) { string result = ""; CustomProfile profile = CustomProfile.GetProfile(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); tAddress Adrs = new tAddress(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objAdr; Adrs.AddressLine1 = dictionary["AddressLine1"].ToString(); Adrs.City = dictionary["City"].ToString(); Adrs.County = "Qatar"; Adrs.State = dictionary["State"].ToString(); if (State == "Edit") { Adrs.ID = Convert.ToInt64(HttpContext.Current.Session["ConID"].ToString()); Adrs.LastModifiedBy = profile.Personal.UserID.ToString(); Adrs.LastModifiedDate = DateTime.Now; UCCommonFilter.EditAddress(Adrs, profile.DBConnection._constr); } else { long DID = Convert.ToInt64(HttpContext.Current.Session["DeptID"].ToString()); long CompanyID = UCCommonFilter.GetCompanyIDFromSiteID(DID, profile.DBConnection._constr); Adrs.ObjectName = "Account"; Adrs.ReferenceID = DID; Adrs.RouteID = CompanyID; Adrs.CompanyID = CompanyID; Adrs.Sequence = 1; Adrs.AddressType = "none"; Adrs.IsDefault = "N"; Adrs.Active = "Y";//Set Active Y N Adrs.CreatedBy = profile.Personal.UserID.ToString(); Adrs.CreationDate = DateTime.Now; UCCommonFilter.AddIntotAddress(Adrs, profile.DBConnection._constr); } result = "Address saved successfully"; } catch { result = "Some error occurred"; } finally { UCCommonFilter.Close(); } return(result); }
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 string WMSaveRequestHead(object objCon, string State) { string result = ""; CustomProfile profile = CustomProfile.GetProfile(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); tContactPersonDetail ConPerD = new tContactPersonDetail(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objCon; ConPerD.Name = dictionary["Name"].ToString(); ConPerD.MobileNo = dictionary["MobileNo"].ToString(); ConPerD.EmailID = dictionary["EmailID"].ToString(); long CompanyID = long.Parse(dictionary["CompanyId"].ToString()); if (State == "Edit") { ConPerD.ID = Convert.ToInt64(HttpContext.Current.Session["ConID"].ToString()); ConPerD.LastModifiedBy = profile.Personal.UserID.ToString(); ConPerD.LastModifiedDate = DateTime.Now; UCCommonFilter.EditContactPerson(ConPerD, profile.DBConnection._constr); } else { //long DID = Convert.ToInt64(HttpContext.Current.Session["DeptID"].ToString()); // long CompanyID = UCCommonFilter.GetCompanyIDFromSiteID(DID, profile.DBConnection._constr); long DID = 0; ConPerD.ReferenceID = CompanyID; ConPerD.Department = DID; ConPerD.CompanyID = CompanyID; ConPerD.Sequence = 1; ConPerD.ObjectName = "Contact"; ConPerD.CustomerHeadID = 0; ConPerD.ContactTypeID = 4; ConPerD.Active = "N"; ConPerD.CreatedBy = profile.Personal.UserID.ToString(); ConPerD.CreationDate = DateTime.Now; UCCommonFilter.AddIntotContactpersonDetail(ConPerD, profile.DBConnection._constr); } result = "Contact saved successfully"; } catch { result = "Some error occurred"; } finally { UCCommonFilter.Close(); } return(result); }
public static List <PORServiceUCCommonFilter.v_GetEngineDetails> WMFillEnginList(long SiteID) { iUCCommonFilterClient objService = new iUCCommonFilterClient(); List <PORServiceUCCommonFilter.v_GetEngineDetails> EngineList = new List <PORServiceUCCommonFilter.v_GetEngineDetails>(); try { CustomProfile profile = CustomProfile.GetProfile(); EngineList = objService.GetEngineOfSite(SiteID.ToString(), profile.DBConnection._constr).ToList(); PORServiceUCCommonFilter.v_GetEngineDetails select = new PORServiceUCCommonFilter.v_GetEngineDetails() { ID = 0, Container = "-Select-" }; EngineList.Insert(0, select); } catch { } finally { objService.Close(); } return(EngineList); }
public static List <vGetUserProfileByUserID> WMFillUserList(long SiteID) { iUCCommonFilterClient objService = new iUCCommonFilterClient(); List <vGetUserProfileByUserID> UsersList = new List <vGetUserProfileByUserID>(); try { CustomProfile profile = CustomProfile.GetProfile(); UsersList = objService.GetUserListBySiteID(SiteID, profile.DBConnection._constr).ToList(); UsersList = UsersList.Distinct().ToList(); vGetUserProfileByUserID select = new vGetUserProfileByUserID() { userID = 0, userName = "******" }; UsersList.Insert(0, select); } catch { } finally { objService.Close(); } return(UsersList); }
//[WebMethod] //public static void WMpageAddNew() //{ ////iHQGoodsReceiptClient objService = new iHQGoodsReceiptClient(); //try //{ // CustomProfile profile = CustomProfile.GetProfile(); // HttpContext.Current.Session["PORHQReceiptID"] = "0"; // HttpContext.Current.Session["PORstate"] = "Add"; // // objService.ClearTempDataFromDB(HttpContext.Current.Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr); // //objService.GetIssuePartDetailByRequestID(Convert.ToInt64(HttpContext.Current.Session["PORRequestID"].ToString()), HttpContext.Current.Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, "true", profile.DBConnection._constr).ToList(); //} //catch { } //finally //{ // objService.Close(); //} //} #endregion #region Fill Dropdown protected void FillSites() { iUCCommonFilterClient objService = new iUCCommonFilterClient(); try { CustomProfile profile = CustomProfile.GetProfile(); List <mTerritory> SiteList = new List <mTerritory>(); // SiteList = objService.GetSiteNameByUserID(profile.Personal.UserID, profile.DBConnection._constr).ToList(); SiteList = objService.GetSiteNameByUserID_IssueID(Convert.ToInt64(Session["PORIssueID"].ToString()), profile.Personal.UserID, profile.DBConnection._constr).ToList(); ddlSites.DataSource = SiteList; ddlSites.DataBind(); ListItem lst = new ListItem { Text = "-Select-", Value = "0" }; ddlSites.Items.Insert(0, lst); if (Session["PORstate"].ToString() == "Add") { ddlSites.SelectedIndex = 1; ddlReceivedBy.DataSource = null; ddlReceivedBy.DataBind(); ddlReceivedBy.DataSource = WMFillUserList(Convert.ToInt64(ddlSites.SelectedItem.Value)); ddlReceivedBy.DataBind(); ddlReceivedBy.SelectedIndex = ddlReceivedBy.Items.IndexOf(ddlReceivedBy.Items.FindByValue(profile.Personal.UserID.ToString())); UC_PODate.Date = DateTime.Now; // UC_ReceiptDate.Date = DateTime.Now; // lblReceiptNo.Text = "Generate when save"; if (ddlStatus.Items.Count > 0) { ddlStatus.SelectedIndex = 1; } } } catch { } finally { objService.Close(); } }
public void fillUser() { BrilliantWMS.WMSInbound.iInboundClient Inbound = new WMSInbound.iInboundClient(); iUCCommonFilterClient objService = new iUCCommonFilterClient(); List <vGetUserProfileByUserID> UsersList = new List <vGetUserProfileByUserID>(); try { CustomProfile profile = CustomProfile.GetProfile(); List <SP_GWC_GetUserInfo_Result> Usrlst = new List <SP_GWC_GetUserInfo_Result>(); Usrlst = objService.GetUsrLst1("", "", profile.DBConnection._constr).ToList(); Usrlst = Usrlst.Where(u => u.ID == profile.Personal.UserID).ToList(); ddlWTWTransferBy.DataSource = Usrlst; ddlWTWTransferBy.DataBind(); ListItem lstUsr = new ListItem { Text = "-Select-", Value = "0" }; ddlWTWTransferBy.Items.Insert(0, lstUsr); } catch { } finally { objService.Close(); } }
protected void FillSites() { iUCCommonFilterClient objService = new iUCCommonFilterClient(); List <mTerritory> SiteList = new List <mTerritory>(); try { CustomProfile profile = CustomProfile.GetProfile(); SiteList = objService.GetSiteNameByUserID(profile.Personal.UserID, profile.DBConnection._constr).ToList(); mTerritory select = new mTerritory() { ID = 0, Territory = "-Select-" }; SiteList.Insert(0, select); ddlSites.DataSource = SiteList; ddlSites.DataBind(); ddlSites.SelectedIndex = 1; } catch { } finally { objService.Close(); } }
protected void GetContactDetailByContactID() { CustomProfile profile = CustomProfile.GetProfile(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); try { tAddress conper = new tAddress(); conper = UCCommonFilter.GetAddressDetailsByID(long.Parse(hdnConID.Value), profile.DBConnection._constr); if (sessionID == null) { sessionID = Session.SessionID; } if (conper.AddressLine1 != null) { txtAddress.Text = conper.AddressLine1.ToString(); } if (conper.City != null) { txtcity.Text = conper.City.ToString(); } bindDropdown(); ddlState.SelectedIndex = ddlState.Items.IndexOf(ddlState.Items.FindByValue(conper.State.ToString())); // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry1" + sessionID, "setCountry('India','Maharashtra','0','0');", true); // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry1" + sessionID, "setCountry('" + conper.County + "','" + conper.State + "','0','0');", true); // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry" + sessionID, "setCountry('" + conper.County + "','" + conper.State + "','" + conper.Zone + "','" + conper.SubZone + "');", true); } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "AddEditSearchAddress", "GetContactDetailByContactID"); } finally { UCCommonFilter.Close(); } }
public void FillUserList(long SiteID) { iUCCommonFilterClient objService = new iUCCommonFilterClient(); List <vGetUserProfileByUserID> UsersList = new List <vGetUserProfileByUserID>(); try { CustomProfile profile = CustomProfile.GetProfile(); UsersList = objService.GetUserListBySiteID(SiteID, profile.DBConnection._constr).ToList(); UsersList = UsersList.Distinct().ToList(); vGetUserProfileByUserID select = new vGetUserProfileByUserID() { userID = 0, userName = "******" }; UsersList.Insert(0, select); ddlIssuedBy.DataSource = null; ddlIssuedBy.DataBind(); ddlIssuedBy.DataSource = UsersList; ddlIssuedBy.DataBind(); } catch { } finally { objService.Close(); } }
public void GetDispatchDetails(string QCID) { long selQCID = 0; BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient(); CustomProfile profile = CustomProfile.GetProfile(); iUCCommonFilterClient objService = new iUCCommonFilterClient(); List <vGetUserProfileByUserID> UsersList = new List <vGetUserProfileByUserID>(); try { if (Session["QCID"] != null) { selQCID = long.Parse(QCID.ToString()); BrilliantWMS.WMSOutbound.WMS_VW_GetDispatchDetails dispatchLst = new WMSOutbound.WMS_VW_GetDispatchDetails(); dispatchLst = Outbound.GetDispatchDetailsByQCID(selQCID, profile.DBConnection._constr); lblDispatchNo.Text = dispatchLst.ID.ToString(); UCDispatchDate.Date = dispatchLst.DispatchDate; txtRemark.Text = dispatchLst.Remark.ToString(); txtAirwayBill.Text = dispatchLst.AirwayBill.ToString(); txtShippingType.Text = dispatchLst.ShippingType.ToString(); UC_ShippingDate.Date = dispatchLst.ShippingDate; UCExpDeliveryDate.Date = dispatchLst.ExpDeliveryDate; txtTransporterName.Text = dispatchLst.TransporterName.ToString(); txtTransporterRemark.Text = dispatchLst.TransporterRemark.ToString(); long WarehouseID = long.Parse(dispatchLst.StoreId.ToString()); UsersList = objService.GetUserListByWarehouseID(WarehouseID, profile.DBConnection._constr).ToList(); UsersList = UsersList.Where(x => x.userID == profile.Personal.UserID).ToList(); vGetUserProfileByUserID select = new vGetUserProfileByUserID() { userID = 0, userName = "******" }; UsersList.Insert(0, select); ddlDispatchBy.DataSource = UsersList; ddlDispatchBy.DataBind(); ddlDispatchBy.SelectedIndex = ddlDispatchBy.Items.IndexOf(ddlDispatchBy.Items.FindByValue(dispatchLst.DispatchBy.ToString())); ddlStatus.DataSource = WMFillStatus(); ddlStatus.DataBind(); ddlStatus.SelectedIndex = ddlStatus.Items.IndexOf(ddlStatus.Items.FindByValue(dispatchLst.Status.ToString())); Grid1.DataSource = Outbound.GetDispatchSkuDetailByDispatchID(long.Parse(dispatchLst.ID.ToString()), profile.DBConnection._constr); Grid1.DataBind(); ScriptManager.RegisterStartupScript(this, this.GetType(), "changemodeRequest" + Session.SessionID, "changemode(true, 'dvDDetail');LoadingOff();", true); } else if (Session["DispID"] != null) { selQCID = long.Parse(QCID.ToString()); BrilliantWMS.WMSOutbound.WMS_VW_GetDispatchDetails dispatchLst = new WMSOutbound.WMS_VW_GetDispatchDetails(); dispatchLst = Outbound.GetDispatchDetailsByDispatchID(selQCID, profile.DBConnection._constr); lblDispatchNo.Text = dispatchLst.ID.ToString(); UCDispatchDate.Date = dispatchLst.DispatchDate; txtRemark.Text = dispatchLst.Remark.ToString(); txtAirwayBill.Text = dispatchLst.AirwayBill.ToString(); txtShippingType.Text = dispatchLst.ShippingType.ToString(); UC_ShippingDate.Date = dispatchLst.ShippingDate; UCExpDeliveryDate.Date = dispatchLst.ExpDeliveryDate; txtTransporterName.Text = dispatchLst.TransporterName.ToString(); txtTransporterRemark.Text = dispatchLst.TransporterRemark.ToString(); long WarehouseID = long.Parse(dispatchLst.StoreId.ToString()); UsersList = objService.GetUserListByWarehouseID(WarehouseID, profile.DBConnection._constr).ToList(); UsersList = UsersList.Where(x => x.userID == profile.Personal.UserID).ToList(); vGetUserProfileByUserID select = new vGetUserProfileByUserID() { userID = 0, userName = "******" }; UsersList.Insert(0, select); ddlDispatchBy.DataSource = UsersList; ddlDispatchBy.DataBind(); ddlDispatchBy.SelectedIndex = ddlDispatchBy.Items.IndexOf(ddlDispatchBy.Items.FindByValue(dispatchLst.DispatchBy.ToString())); ddlStatus.DataSource = WMFillStatus(); ddlStatus.DataBind(); ddlStatus.SelectedIndex = ddlStatus.Items.IndexOf(ddlStatus.Items.FindByValue(dispatchLst.Status.ToString())); Grid1.DataSource = Outbound.GetDispatchSkuDetailByDispatchID(long.Parse(dispatchLst.ID.ToString()), profile.DBConnection._constr); Grid1.DataBind(); ScriptManager.RegisterStartupScript(this, this.GetType(), "changemodeRequest" + Session.SessionID, "changemode(true, 'dvDDetail');LoadingOff();", true); } else if (Session["TRID"] != null) { selQCID = long.Parse(QCID.ToString()); BrilliantWMS.WMSOutbound.WMS_VW_GetDispatchDetails dispatchLst = new WMSOutbound.WMS_VW_GetDispatchDetails(); dispatchLst = Outbound.GetDispatchDetailsByQCID(selQCID, profile.DBConnection._constr); lblDispatchNo.Text = dispatchLst.ID.ToString(); UCDispatchDate.Date = dispatchLst.DispatchDate; txtRemark.Text = dispatchLst.Remark.ToString(); txtAirwayBill.Text = dispatchLst.AirwayBill.ToString(); txtShippingType.Text = dispatchLst.ShippingType.ToString(); UC_ShippingDate.Date = dispatchLst.ShippingDate; UCExpDeliveryDate.Date = dispatchLst.ExpDeliveryDate; txtTransporterName.Text = dispatchLst.TransporterName.ToString(); txtTransporterRemark.Text = dispatchLst.TransporterRemark.ToString(); long WarehouseID = long.Parse(dispatchLst.StoreId.ToString()); UsersList = objService.GetUserListByWarehouseID(WarehouseID, profile.DBConnection._constr).ToList(); UsersList = UsersList.Where(x => x.userID == profile.Personal.UserID).ToList(); vGetUserProfileByUserID select = new vGetUserProfileByUserID() { userID = 0, userName = "******" }; UsersList.Insert(0, select); ddlDispatchBy.DataSource = UsersList; ddlDispatchBy.DataBind(); ddlDispatchBy.SelectedIndex = ddlDispatchBy.Items.IndexOf(ddlDispatchBy.Items.FindByValue(dispatchLst.DispatchBy.ToString())); ddlStatus.DataSource = WMFillStatus(); ddlStatus.DataBind(); ddlStatus.SelectedIndex = ddlStatus.Items.IndexOf(ddlStatus.Items.FindByValue(dispatchLst.Status.ToString())); Grid1.DataSource = Outbound.GetDispatchSkuDetailByDispatchID(long.Parse(dispatchLst.ID.ToString()), profile.DBConnection._constr); Grid1.DataBind(); ScriptManager.RegisterStartupScript(this, this.GetType(), "changemodeRequest" + Session.SessionID, "changemode(true, 'dvDDetail');LoadingOff();", true); } } catch { } finally { Outbound.Close(); objService.Close(); UsersList.Clear(); } }
protected void FillSites() { iUCCommonFilterClient objService = new iUCCommonFilterClient(); try { CustomProfile profile = CustomProfile.GetProfile(); List <mCompany> CompanyLst = new List <mCompany>(); string UserType = profile.Personal.UserType.ToString(); long UID = profile.Personal.UserID; if (UserType == "Admin") { // CompanyLst = objService.GetCompanyName(profile.DBConnection._constr).ToList(); // CompanyLst = objService.GetUserCompanyName(UID, profile.DBConnection._constr).ToList(); CompanyLst = objService.GetUserCompanyNameNEW(UID, profile.DBConnection._constr).ToList(); } else if (UserType == "User" || UserType == "Requester And Approver" || UserType == "Requester" || profile.Personal.UserType == "Requestor" || profile.Personal.UserType == "Requestor And Approver") { CompanyLst = objService.GetUserCompanyName(UID, profile.DBConnection._constr).ToList(); } else { CompanyLst = objService.GetCompanyName(profile.DBConnection._constr).ToList(); } ddlCompany.DataSource = CompanyLst; ddlCompany.DataBind(); if (UserType == "Admin") { // ListItem lstCmpny = new ListItem { Text = "-Select-", Value = "0" }; //ddlCompany.Items.Insert(0, lstCmpny); if (ddlCompany.Items.Count > 0) { ddlCompany.SelectedIndex = 0; //1; } hdnselectedCompany.Value = ddlCompany.SelectedValue.ToString(); List <mTerritory> SiteLst = new List <mTerritory>(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); // SiteLst = UCCommonFilter.GetSiteNameByUserID(Convert.ToInt16(UID), profile.DBConnection._constr).ToList(); int Cmpny = int.Parse(hdnselectedCompany.Value); SiteLst = WMGetSelDept(Cmpny, profile.Personal.UserID); ddlSites.DataSource = SiteLst; ddlSites.DataBind(); if (ddlSites.Items.Count > 0) { ddlSites.SelectedIndex = 0; // 1; } hdnselectedDept.Value = ddlSites.SelectedValue.ToString(); Session["DeptID"] = ddlSites.SelectedValue.ToString(); //long DeptID = UCCommonFilter.GetSiteIdOfUser(UID, profile.DBConnection._constr); hdnselectedDept.Value = DeptID.ToString(); Session["DeptID"] = DeptID.ToString(); //long CompanyID = UCCommonFilter.GetCompanyIDFromSiteID(DeptID, profile.DBConnection._constr); hdnselectedCompany.Value = CompanyID.ToString(); //ddlContact1.DataSource = WMGetContactPersonLst(CompanyID); //WMGetContactPersonLst(DeptID); //ddlContact1.DataBind(); //ListItem lstContact = new ListItem { Text = "-Select-", Value = "0" }; //ddlContact1.Items.Insert(0, lstContact); //ddlAddress.DataSource = WMGetDeptAddress(CompanyID); //WMGetDeptAddress(DeptID); //ddlAddress.DataBind(); //ListItem lstAdrs = new ListItem { Text = "-Select-", Value = "0" }; //ddlAddress.Items.Insert(0, lstAdrs); } else if (UserType == "User" || UserType == "Requester And Approver" || UserType == "Requester" || profile.Personal.UserType == "Requestor" || profile.Personal.UserType == "Requestor And Approver") { ddlCompany.Enabled = false; List <mTerritory> SiteLst = new List <mTerritory>(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); //SiteLst = UCCommonFilter.GetDepartmentListUserWise(Convert.ToInt16(UID), profile.DBConnection._constr).ToList(); SiteLst = UCCommonFilter.GetSiteNameByUserID(Convert.ToInt16(UID), profile.DBConnection._constr).ToList(); ddlSites.DataSource = SiteLst; ddlSites.DataBind(); if (ddlSites.Items.Count > 0) { ddlSites.SelectedIndex = 1; } // ddlSites.Enabled = false; long DeptID = UCCommonFilter.GetSiteIdOfUser(UID, profile.DBConnection._constr); hdnselectedDept.Value = DeptID.ToString(); Session["DeptID"] = DeptID.ToString(); long CompanyID = UCCommonFilter.GetCompanyIDFromSiteID(DeptID, profile.DBConnection._constr); hdnselectedCompany.Value = CompanyID.ToString(); //ddlContact1.DataSource = WMGetContactPersonLst(CompanyID); //WMGetContactPersonLst(DeptID); //ddlContact1.DataBind(); //ListItem lstContact = new ListItem { Text = "-Select-", Value = "0" }; //ddlContact1.Items.Insert(0, lstContact); //ddlAddress.DataSource = WMGetDeptAddress(CompanyID); //WMGetDeptAddress(DeptID); //ddlAddress.DataBind(); //ListItem lstAdrs = new ListItem { Text = "-Select-", Value = "0" }; //ddlAddress.Items.Insert(0, lstAdrs); } else { ListItem lstCmpny = new ListItem { Text = "-Select-", Value = "0" }; ddlCompany.Items.Insert(0, lstCmpny); if (ddlCompany.Items.Count > 0) { ddlCompany.SelectedIndex = 1; } List <mTerritory> SiteLst = new List <mTerritory>(); iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient(); SiteLst = UCCommonFilter.GetSiteNameByUserID(Convert.ToInt16(UID), profile.DBConnection._constr).ToList(); ddlSites.DataSource = SiteLst; ddlSites.DataBind(); if (ddlSites.Items.Count > 0) { ddlSites.SelectedIndex = 1; } long DeptID = UCCommonFilter.GetSiteIdOfUser(UID, profile.DBConnection._constr); hdnselectedDept.Value = DeptID.ToString(); Session["DeptID"] = DeptID.ToString(); long CompanyID = UCCommonFilter.GetCompanyIDFromSiteID(DeptID, profile.DBConnection._constr); hdnselectedCompany.Value = CompanyID.ToString(); //ddlContact1.DataSource = WMGetContactPersonLst(CompanyID); //WMGetContactPersonLst(DeptID); //ddlContact1.DataBind(); //ListItem lstContact = new ListItem { Text = "-Select-", Value = "0" }; //ddlContact1.Items.Insert(0, lstContact); //ddlAddress.DataSource = WMGetDeptAddress(CompanyID); //WMGetDeptAddress(DeptID); //ddlAddress.DataBind(); //ListItem lstAdrs = new ListItem { Text = "-Select-", Value = "0" }; //ddlAddress.Items.Insert(0, lstAdrs); } } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "Request Template", "FillSites"); } finally { objService.Close(); } }
public void fillUser() { BrilliantWMS.WMSInbound.iInboundClient Inbound = new WMSInbound.iInboundClient(); BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient(); iUCCommonFilterClient objService = new iUCCommonFilterClient(); List <vGetUserProfileByUserID> UsersList = new List <vGetUserProfileByUserID>(); try { CustomProfile profile = CustomProfile.GetProfile(); BrilliantWMS.WMSOutbound.tOrderHead OH = new WMSOutbound.tOrderHead(); long WarehouseID = 0; if (Session["QCID"] != null) { int chkJObCart = Inbound.CheckJobCard(Convert.ToInt64(HttpContext.Current.Session["QCID"].ToString()), "SalesOrder", profile.DBConnection._constr); if (chkJObCart >= 1) { DataSet dsJCN = new DataSet(); dsJCN = Outbound.CheckSelectedSOJobCardNo(Convert.ToInt64(HttpContext.Current.Session["QCID"].ToString()), "SalesOrder", profile.DBConnection._constr); if (dsJCN != null && dsJCN.Tables[0].Rows.Count > 0) { //lblSelectedPO.Text = dsJCN.Tables[0].Rows[0]["OrderNo"].ToString(); //lblSelectedGTN.Text = dsJCN.Tables[0].Rows[0]["JobCardName"].ToString(); //lblPurchaseOrderDate.Text = dsJCN.Tables[0].Rows[0]["CreationDate"].ToString(); //lblPOBy.Text = dsJCN.Tables[0].Rows[0]["CreatedByUser"].ToString(); WarehouseID = long.Parse(dsJCN.Tables[0].Rows[0]["Warehouse"].ToString()); } } else { OH = Outbound.GetSoDetailByQCID(Convert.ToInt64(HttpContext.Current.Session["QCID"].ToString()), profile.DBConnection._constr); //lblSelectedPO.Text = Session["POID"].ToString(); //lblSelectedGTN.Text = "Not Created"; //lblPurchaseOrderDate.Text = POHead.POdate.Value.ToString("dd-MMM-yyyy"); //lblPOBy.Text = Inbound.GetUserNameByID(long.Parse(POHead.CreatedBy.ToString()), profile.DBConnection._constr); WarehouseID = long.Parse(OH.StoreId.ToString()); } } else if (Session["TRID"] != null) { int chkJObCart = Inbound.CheckJobCard(Convert.ToInt64(HttpContext.Current.Session["TRID"].ToString()), "Transfer", profile.DBConnection._constr); if (chkJObCart >= 1) { DataSet dsJCN = new DataSet(); dsJCN = Outbound.CheckSelectedSOJobCardNo(Convert.ToInt64(HttpContext.Current.Session["TRID"].ToString()), "Transfer", profile.DBConnection._constr); if (dsJCN != null && dsJCN.Tables[0].Rows.Count > 0) { WarehouseID = long.Parse(dsJCN.Tables[0].Rows[0]["Warehouse"].ToString()); } } else { BrilliantWMS.WMSInbound.tTransferHead TRHead = new WMSInbound.tTransferHead(); TRHead = Inbound.GetTransferHeadByTRID(Convert.ToInt64(HttpContext.Current.Session["TRID"].ToString()), profile.DBConnection._constr); WarehouseID = long.Parse(TRHead.FromPosition.ToString()); } } UsersList = objService.GetUserListByWarehouseID(WarehouseID, profile.DBConnection._constr).ToList(); UsersList = UsersList.Where(x => x.userID == profile.Personal.UserID).ToList(); vGetUserProfileByUserID select = new vGetUserProfileByUserID() { userID = 0, userName = "******" }; UsersList.Insert(0, select); ddlDispatchBy.DataSource = UsersList; ddlDispatchBy.DataBind(); } catch { } finally { objService.Close(); } }