예제 #1
0
        protected void BindProductList()
        {
            ProductController sysmgr = new ProductController();
            List <Product>    info   = sysmgr.ListAllProducts();

            ProductGrid.DataSource = info;
            ProductGrid.DataBind();
        }
        public void bindGrid() //function to bind gridView(Read Operation)
        {
            using (LatihanEntities context = new LatihanEntities())
            {
                ProductGrid.DataSource = (from product in context.Products
                                          select new
                {
                    Id = product.Id,
                    Name = product.Name,
                    Brand = product.Brand,
                    Category = product.Category,
                    Price = product.Price
                }).ToList();

                ProductGrid.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            EClient user = (EClient)Session["user"];

            if (user != null)
            {
                welc.Text    = "Hoşgeldin " + user.name + " !  İşte Yemeklerimiz";
                welc.Visible = true;
                if (!IsPostBack)
                {
                    ProductGrid.DataSource = BLLProduct.SelectProduct_Category(1);
                    using (System.IO.StreamWriter file =
                               new System.IO.StreamWriter(submittedFilePath, true))
                    {
                        file.WriteLine("[" + DateTime.Now + "] DB PRODUCTS SELECTED BY CATEGORY");
                    }
                    ProductGrid.DataBind();
                    aperatifGrid.DataSource = BLLProduct.SelectProduct_Category(2);
                    using (System.IO.StreamWriter file =
                               new System.IO.StreamWriter(submittedFilePath, true))
                    {
                        file.WriteLine("[" + DateTime.Now + "] DB PRODUCTS SELECTED BY CATEGORY");
                    }
                    aperatifGrid.DataBind();
                    IcecekGrid.DataSource = BLLProduct.SelectProduct_Category(3);
                    using (System.IO.StreamWriter file =
                               new System.IO.StreamWriter(submittedFilePath, true))
                    {
                        file.WriteLine("[" + DateTime.Now + "] DB PRODUCTS SELECTED BY CATEGORY");
                    }
                    IcecekGrid.DataBind();
                    tatlıGrid.DataSource = BLLProduct.SelectProduct_Category(4);
                    using (System.IO.StreamWriter file =
                               new System.IO.StreamWriter(submittedFilePath, true))
                    {
                        file.WriteLine("[" + DateTime.Now + "] DB PRODUCTS SELECTED BY CATEGORY");
                    }
                    tatlıGrid.DataBind();
                }
            }
            else
            {
                welc.Visible = false;
                Response.Redirect("~/Default.aspx");
            }
        }
예제 #4
0
        public void Search(string name, decimal?min_price, decimal?max_price, int page, int take, int?supplierId)
        {
            using (var ctx = new ProductMNEntities())
            {
                var domain = new ProductDomain(ctx);
                var model  = domain.QueryFilter(name, min_price, max_price, page, take, supplierId);

                ProductGrid.DataSource = model.list;
                ProductGrid.DataBind();

                total_count = model.total_count;
                this.page   = page;

                //LiteralControl pagination_elements = new LiteralControl();
                //var pagination = Request.Form["pagination"];

                //Console.WriteLine(pagination);
                //if (pagination != null)
                //{
                //    pagination_elements.Text += @"<li><a href='#'>1</a></li>";
                //    pagination.Controls.Add(pagination_elements);
                //}
            }
        }
예제 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     SQLDataClass.getAllProducts();
     ProductGrid.DataSource = SQLDataClass.tblProduct;
     ProductGrid.DataBind();
 }
예제 #6
0
 protected void ProductGrid_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     ProductGrid.PageIndex = e.NewPageIndex;
     ProductGrid.DataBind();
 }
예제 #7
0
 private void BindData()
 {
     _products = _repo.GetAll();
     ProductGrid.DataSource = _products;
     ProductGrid.DataBind();
 }