Пример #1
0
        public void FillProductCategoryDropDown()
        {
            try
            {
                List <FBFoodInventoryInfo> items;
                FBFoodInventoryController  controller = new FBFoodInventoryController();

                items = controller.FBProductCategory_List(this.ModuleId);

                if (items.Count == 0)
                {
                    lblDebug.Text     = Localization.GetString("errorAddCategoriesFirst.Text", LocalResourceFile).ToString();
                    btnAddNew.Enabled = false;
                }

                ddlProductCategory.DataTextField  = "ProductCategory";
                ddlProductCategory.DataValueField = "ProductCategoryID";
                ddlProductCategory.DataSource     = items;
                ddlProductCategory.DataBind();
                ddlProductCategory.Items.Insert(0, new ListItem("-- Select --", "0"));


                ddlFilterCategory.DataTextField  = "ProductCategory";
                ddlFilterCategory.DataValueField = "ProductCategoryID";
                ddlFilterCategory.DataSource     = items;
                ddlFilterCategory.DataBind();
                ddlFilterCategory.Items.Insert(0, new ListItem("Filter Category", "0"));
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
        public void FillProductCategoryGrid()
        {
            try
            {
                List <FBFoodInventoryInfo> items;
                FBFoodInventoryController  controller = new FBFoodInventoryController();
                items = controller.FBProductCategory_List(this.ModuleId);


                dt = Components.GridViewTools.ToDataTable(items);

                DataView dv = dt.DefaultView;

                dv.RowFilter = "IsActive = 1";


                if (cbxShowInActive.Checked == true)
                {
                    dv.RowFilter += " or IsActive = 0";
                }

                gvProductCategory.DataSource = dv;
                gvProductCategory.DataBind();
                lblTotalRecordCount.Text = items.Count.ToString();
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Пример #3
0
        public void FillDropDowns()
        {
            try
            {
                // CreatePrefixSuffixDropdowns();

                List <FBFoodInventoryInfo> items;
                FBFoodInventoryController  controller = new FBFoodInventoryController();

                items = controller.FBProductCategory_List(this.ModuleId);

                dtProductCategories = Components.GridViewTools.ToDataTable(items);

                DataView dv = dtProductCategories.DefaultView;

                dv.RowFilter = "IsActive = 1";


                ddlFilterCategory.DataTextField  = "ProductCategory";
                ddlFilterCategory.DataValueField = "ProductCategoryID";
                ddlFilterCategory.DataSource     = dv;
                ddlFilterCategory.DataBind();
                ddlFilterCategory.Items.Insert(0, new ListItem("- Select Category -", "0"));


                var Organizations = new ListController().GetListEntryInfoItems("ClientOrganizations", "", this.PortalId);

                if (Organizations.ToList().Count == 0)
                {
                    CreateOrganizationList();
                    Organizations = new ListController().GetListEntryInfoItems("ClientOrganizations", "", this.PortalId);
                }

                ddlOrganization.DataTextField  = "Text";
                ddlOrganization.DataValueField = "Text";
                ddlOrganization.DataSource     = Organizations;
                ddlOrganization.DataBind();
                //  ddlOrganization.Items.Insert(0, new ListItem("--Select--", ""));
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }