Exemple #1
0
        public void LoadDDL()
        {
            Brands_BAL     Bnds   = new Brands_BAL();
            Categories_BAL cate   = new Categories_BAL();
            DataSet        ds     = Bnds.GetAllBrand();
            DataSet        dsCate = cate.GetAllCategories();

            if (ds.Tables[0].Rows.Count > 0)
            {
                //Dispose the Dataset first.
                ds.Dispose();
                DDLBrand.Items.Clear();
                DDLBrand.DataSource     = ds;
                DDLBrand.DataTextField  = "BrandName";
                DDLBrand.DataValueField = "BrandID";
                DDLBrand.DataBind();
                DDLBrand.Items.Insert(0, new ListItem("-- Select any brand --", "0"));
            }
            if (dsCate.Tables[0].Rows.Count > 0)
            {
                //Dispose the Dataset first.
                ds.Dispose();
                DDLCategory.Items.Clear();
                DDLCategory.DataSource     = dsCate;
                DDLCategory.DataTextField  = "CategoryName";
                DDLCategory.DataValueField = "CategoryID";
                DDLCategory.DataBind();
                DDLCategory.Items.Insert(0, new ListItem("-- Select any category --", "0"));
            }
        }
Exemple #2
0
        public void Gridview()
        {
            DataSet Brands = ObjBnd.GetAllBrand();

            dataTables.DataSource = Brands;
            dataTables.DataBind();
        }
Exemple #3
0
        public void grid()
        {
            DataSet Brands = ObjBal.GetAllBrand();

            Repeater1.DataSource = Brands;
            Repeater1.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string Id = Request.QueryString["Id"];

                DataSet Brand = Objbnd.GetAllBrand();

                DataRow[] row = Brand.Tables[0].Select("BrandID=" + Id);

                BrandId.Value     = row[0].ItemArray[0].ToString();
                BrandName.Text    = row[0].ItemArray[1].ToString();
                BrandDesc.Text    = row[0].ItemArray[2].ToString();
                BrandImgUrl.Value = row[0].ItemArray[4].ToString();
                Image1.ImageUrl   = "Images/BrandLogos/" + row[0].ItemArray[4].ToString();
            }
        }
Exemple #5
0
        public void GridView()
        {
            DataSet   ds = ItemObj.GetAllItems();
            DataTable Dt = ds.Tables[0].AsEnumerable().Take(6).CopyToDataTable();

            Repeater1.DataSource = Dt;
            Repeater1.DataBind();

            DataSet   dsB = BalObj.GetAllBrand();
            DataTable DtB = dsB.Tables[0].AsEnumerable().Take(6).CopyToDataTable();

            Repeater2.DataSource = DtB;
            Repeater2.DataBind();

            DataSet   dsC = CateObj.GetAllCategories();
            DataTable DtC = dsC.Tables[0].AsEnumerable().Take(6).CopyToDataTable();

            Repeater3.DataSource = DtC;
            Repeater3.DataBind();
        }