예제 #1
0
    /// <summary>
    /// Bind data to the drop down list
    /// </summary>
    public void BindDropDownData()
    {
        //Add the manufacturers to the drop-down list
        ManufacturerAdmin manuadmin = new ManufacturerAdmin();
        dmanufacturer.DataSource = manuadmin.GetAllByPortalID(ZNodeConfigManager.SiteConfig.PortalID);
        dmanufacturer.DataTextField = "Name";
        dmanufacturer.DataValueField = "ManufacturerID";
        dmanufacturer.DataBind();
        ListItem item = new ListItem("ALL", "0");
        dmanufacturer.Items.Insert(0, item);
        //making ALL as the default value of the drop-down list box
        dmanufacturer.SelectedIndex = 0;

        //Add Producttypes to the drop-down list
        ProductTypeAdmin producttypeadmin = new ProductTypeAdmin();
        dproducttype.DataSource = producttypeadmin.GetAllProductType(ZNodeConfigManager.SiteConfig.PortalID);
        dproducttype.DataTextField = "Name";
        dproducttype.DataValueField = "Producttypeid";
        dproducttype.DataBind();
        ListItem item1 = new ListItem("ALL", "0");
        dproducttype.Items.Insert(0, item1);
        dproducttype.SelectedIndex = 0;

        //Add Product categories to the drop-down list
        CategoryAdmin categoryadmin = new CategoryAdmin();
        dproductcategory.DataSource = categoryadmin.GetAllCategories(ZNodeConfigManager.SiteConfig.PortalID);
        dproductcategory.DataTextField = "Name";
        dproductcategory.DataValueField = "Categoryid";
        dproductcategory.DataBind();
        ListItem item2 = new ListItem("ALL", "0");
        dproductcategory.Items.Insert(0, item2);
        dproductcategory.SelectedIndex = 0;
    }
예제 #2
0
    protected void uxGrid_Sorting(object sender, GridViewSortEventArgs e)
    {
        if (IsSearchEnabled)
        {
            ManufacturerAdmin manufaturer = new ManufacturerAdmin();
            DataSet ds = manufaturer.GetManufacturerBySearchData(txtManufacturerName.Text.Trim());
            uxGrid.DataSource = SortDataTable(ds, e.SortExpression, true);
            uxGrid.DataBind();
        }
        else
        {
            ManufacturerAdmin ManuAdmin = new ManufacturerAdmin();
            DataSet ds = ManuAdmin.GetAllByPortalID(ZNode.Libraries.Framework.Business.ZNodeConfigManager.SiteConfig.PortalID).ToDataSet(true);
            uxGrid.DataSource = SortDataTable(ds, e.SortExpression, true);
            uxGrid.DataBind();
        }

        if (GetSortDirection() == "DESC")
        {
            e.SortDirection = SortDirection.Descending;
        }
        else
        {
            e.SortDirection = SortDirection.Ascending;
        }
    }
예제 #3
0
    public void BindData()
    {
        //Bind product Type
        ProductTypeAdmin productTypeAdmin = new ProductTypeAdmin();

        ProductTypeList.DataSource = productTypeAdmin.GetAllProductTypes(ZNodeConfigManager.SiteConfig.PortalID);
        ProductTypeList.DataTextField = "name";
        ProductTypeList.DataValueField = "productTypeid";
        ProductTypeList.DataBind();

        //Bind Manufacturer
        ManufacturerAdmin ManufacturerAdmin = new ManufacturerAdmin();
        ManufacturerList.DataSource=ManufacturerAdmin.GetAllByPortalID(ZNodeConfigManager.SiteConfig.PortalID);
        ManufacturerList.DataTextField = "name";
        ManufacturerList.DataValueField = "manufacturerid";
        ManufacturerList.DataBind();
        ListItem li = new ListItem("No Manufacturer Selected", "0");
        ManufacturerList.Items.Insert(0,li);

        //Bind Supplier
        SupplierService serv = new SupplierService();
        TList<ZNode.Libraries.DataAccess.Entities.Supplier> list = serv.GetAll();
        list.Sort("DisplayOrder Asc");
        list.ApplyFilter(delegate(ZNode.Libraries.DataAccess.Entities.Supplier supplier)
        { return (supplier.ActiveInd == true); });

        DataSet ds = list.ToDataSet(false);
        DataView dv = new DataView(ds.Tables[0]);
        ddlSupplier.DataSource = dv;
        ddlSupplier.DataTextField = "name";
        ddlSupplier.DataValueField = "supplierid";
        ddlSupplier.DataBind();
        ListItem li1 = new ListItem("None", "0");
        ddlSupplier.Items.Insert(0, li1);

        //Bind Categories
        this.BindTreeViewCategory();

        // Bind Tax Class
        TaxRuleAdmin TaxRuleAdmin = new TaxRuleAdmin();
        ddlTaxClass.DataSource = TaxRuleAdmin.GetAllTaxClass();
        ddlTaxClass.DataTextField = "name";
        ddlTaxClass.DataValueField = "TaxClassID";
        ddlTaxClass.DataBind();
    }