Example #1
0
        private void LoadDDLs()
        {
            ServiceTypes types = new ServiceTypes();
            types.LoadAll();
            Companies objCompany = new Companies();
            objCompany.GetCompanyByUserName(User.Identity.Name);

            CompanyEnabledOptions options = new CompanyEnabledOptions();
            options.GetCompanyEnabledOptionsByCompanyID(objCompany.CompanyID);
            string filter =" ServiceTypeID in ( ";
            for (int i = 0; i < options.RowCount; i++)
            {
                if ((options.PackageOptionID == 11 || options.PackageOptionID == 12 || options.PackageOptionID == 13 || options.PackageOptionID == 14))
                {
                    if (options.Enabled && options.PackageOptionID == 11)
                        filter += " 1 , ";
                    else if (options.Enabled && options.PackageOptionID == 12)
                        filter += " 6 , ";
                    else if (options.Enabled && options.PackageOptionID == 13)
                        filter += " 3 , ";
                    else if (options.Enabled && options.PackageOptionID == 14)
                        filter += " 7 , ";
                }
                options.MoveNext();
            }

            filter = filter.Substring(0, filter.LastIndexOf(",") - 1);
            filter += ")";
            types.Filter = filter;
            uiDropDownListAllServiceType.DataSource = types.DefaultView;
            uiDropDownListAllServiceType.DataTextField = "ArName";
            uiDropDownListAllServiceType.DataValueField = "ServiceTypeID";
            uiDropDownListAllServiceType.DataBind();
            uiDropDownListAllServiceType.SelectedIndex = 0;
        }
        private void LoadDDLs()
        {
            Categories objData = new Categories();
            objData.LoadAll();
            uiDropDownListAllCategories.DataSource = objData.DefaultView;
            uiDropDownListAllCategories.DataTextField = "ArName";
            uiDropDownListAllCategories.DataValueField = "CategoryID";
            uiDropDownListAllCategories.DataBind();

            ServiceTypes objData2 = new ServiceTypes();
            objData2.LoadAll();
            uiDropDownListServiceTypes.DataSource = objData2.DefaultView;
            uiDropDownListServiceTypes.DataTextField = "ArName";
            uiDropDownListServiceTypes.DataValueField = "ServiceTypeID";
            uiDropDownListServiceTypes.DataBind();
        }
 private void BindData()
 {
     ServiceTypes objData = new ServiceTypes();
     objData.LoadAll();
     uiGridViewServiceTypes.DataSource = objData.DefaultView;
     uiGridViewServiceTypes.DataBind();
 }