Exemple #1
0
        public void Bindropdown()
        {
            CustomProfile        profile       = CustomProfile.GetProfile();
            iProductMasterClient productClient = new iProductMasterClient();

            //ddlProductType.DataSource = productClient.GetProductTypeList(profile.DBConnection._constr);
            //ddlProductType.DataBind();

            //ListItem lst1 = new ListItem();
            //lst1.Text = "-Select-";
            //lst1.Value = "0";
            //ddlProductType.Items.Insert(0, lst1);

            ddlUOM.SelectedIndex = -1;
            ddlUOM.DataSource    = productClient.GetProductUOMList(profile.DBConnection._constr);
            ddlUOM.DataBind();
            ListItem lst3 = new ListItem();

            lst3.Text  = "-Select-";
            lst3.Value = "0";
            ddlUOM.Items.Insert(0, lst3);
            productClient.Close();

            BrilliantWMS.ProductCategoryService.iProductCategoryMasterClient productcategoryClient = new BrilliantWMS.ProductCategoryService.iProductCategoryMasterClient();
            //ProductCategoryService.connectiondetails conn = new ProductCategoryService.connectiondetails() { DataBaseName = Profile.DataBase, DataSource = Profile.DataSource, DBPassword = Profile.DBPassword };

            ddlCategory.SelectedIndex = -1;
            ddlCategory.DataSource    = productcategoryClient.GetProductCategoryListForAsset(profile.DBConnection._constr);
            ddlCategory.DataBind();
            productcategoryClient.Close();
            ListItem lst2 = new ListItem();

            lst2.Text  = "-Select-";
            lst2.Value = "0";
            ddlCategory.Items.Insert(0, lst2);


            iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient();

            ddlNewSite.DataSource = UCCommonFilter.GetSiteNameByUserID(profile.Personal.UserID, profile.DBConnection._constr);
            ddlNewSite.DataBind();
            ListItem lst = new ListItem();

            lst.Text  = "--Select--";
            lst.Value = "0";
            ddlNewSite.Items.Insert(0, lst);
        }
Exemple #2
0
        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();

                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(); }
        }
        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 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(); }
        }