Example #1
0
        public ActionResult ProdDelete(string id)
        {

            Session["ControllerName"] = "Delete Product";
            if (Session["loginDetails"] != null)
            {
                ProductAdminBLL bll = new ProductAdminBLL();
                ProductDetails productdetails = bll.Get_product_list().Single(b => b.Prod_Id == id);

                return View(productdetails);
            }
            else
            {

                return RedirectToAction("Error");
            }
        }
Example #2
0
        public ActionResult ProductList(int page = 1)
        {

            Session["ControllerName"] = "Product List";
            if (Session["loginDetails"] != null)
            {
                int pageSize = 10;
                int totalPage = 0;
                int totalRecord = 0;
                List<ProductDetails> pdet = new List<BLL.ProductDetails>();
                ProductAdminBLL bll = new ProductAdminBLL();
                totalRecord = bll.Get_product_list().Count();
                totalPage = (totalRecord / pageSize) + ((totalRecord % pageSize) > 0 ? 1 : 0);
                pdet = bll.Get_product_list().OrderBy(a => a.Prod_Name).Skip(((page - 1) * pageSize)).Take(pageSize).ToList();
                ViewBag.TotalRows = totalRecord;
                ViewBag.PageSize = pageSize;
                
                return View(pdet);
            }
            else
            {

                return RedirectToAction("Error");
            }
        }
Example #3
0
        public ActionResult ProdEdit(string id)
        {

            Session["ControllerName"] = "Prod Edit";
            if (Session["loginDetails"] != null)
            {
                getDdlsForProduct();
                LoadCategoryDDL();
                ViewBag.DDLBrand = new SelectList(ddlbrand, "Value", "Text").ToList();
                //ViewBag.SubCategory = new SelectList(ddlSubCategory, "Value", "Text").ToList();

                ProductAdminBLL bll = new ProductAdminBLL();
                ProductDetails productdetails = bll.Get_product_list().Single(b => b.Prod_Id == id);

                return View(productdetails);
            }
            else
            {

                return RedirectToAction("Error");
            }
        }