Ejemplo n.º 1
0
        public void ddlSubCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            using (dbDatabaseDataDataContext db = new dbDatabaseDataDataContext())
            {
                var pro = (from a in db.tbl_ProductListDtls
                           where a.IsDelete == false & a.SubCatId == int.Parse(ddlSubCategory.SelectedItem.Value)
                           select new
                {
                    a.ProductId,
                    a.ProductName
                }).ToList();

                ddlProduct.DataSource     = pro;
                ddlProduct.DataTextField  = "ProductName";
                ddlProduct.DataValueField = "ProductId";
                ddlProduct.DataBind();
                db.Dispose();
                ddlProduct.Items.Insert(0, new ListItem("--Select Product--", "0"));

                //var value = int.Parse(ddlProduct.SelectedItem.Value);
                //var value = int.Parse(ddlSubCategory.SelectedItem.Value);
                //var getData = (from s in db.stockItemList(value) select s).ToList();
                //gvItemList.DataSource = getData;
                //gvItemList.DataBind();
                //gvItemList.Visible = true;
            }
        }
Ejemplo n.º 2
0
        protected void ddlAddCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            using (dbDatabaseDataDataContext db = new dbDatabaseDataDataContext())
            {
                var Subcat = (from a in db.tbl_SubCategoryDtls
                              where a.IsDelete == false & a.CatId == int.Parse(ddlAddCategory.SelectedItem.Value)
                              select new { a.SubCatId, a.SubCatName, }).ToList();


                ddlSubCategoryPnlProd.DataSource     = Subcat;
                ddlSubCategoryPnlProd.DataTextField  = "SubCatName";
                ddlSubCategoryPnlProd.DataValueField = "SubCatId";
                ddlSubCategoryPnlProd.DataBind();
                db.Dispose();
                ddlSubCategoryPnlProd.Items.Insert(0, new ListItem("--Select Sub-Category--", "0"));
            }
        }
Ejemplo n.º 3
0
 protected void ddlSubCat_SelectedIndexChanged(object sender, EventArgs e)
 {
     using (dbDatabaseDataDataContext db = new dbDatabaseDataDataContext())
     {
         var product = (from a in db.tbl_ProductListDtls
                        where a.IsDelete == false & a.SubCatId == int.Parse(ddlSubCat.SelectedItem.Value)
                        select new
         {
             a.ProductId,
             a.ProductName
         }).ToList();
         ddlProduct.DataSource     = product;
         ddlProduct.DataTextField  = "ProductName";
         ddlProduct.DataValueField = "ProductId";
         ddlProduct.DataBind();
         db.Dispose();
         ddlProduct.Items.Insert(0, new ListItem("--Select Sub-Product--", "0"));
     }
 }
Ejemplo n.º 4
0
        protected void BindCategory()
        {
            using (dbDatabaseDataDataContext db = new dbDatabaseDataDataContext())
            {
                var cat = (from a in db.mstCategories
                           where a.IsDelete == false
                           select new
                {
                    a.CatId,
                    a.CategoryName
                }).ToList();

                ddlCategory.DataSource     = cat;
                ddlCategory.DataTextField  = "CategoryName";
                ddlCategory.DataValueField = "CatId";
                ddlCategory.DataBind();
                db.Dispose();
                ddlCategory.Items.Insert(0, new ListItem("--Select Category--", "0"));
            }
        }