Example #1
0
        public ActionResult EditBrand_Post(Brand brand)
        {
            Session["ControllerName"] = "Edit Brand";
            if (Session["loginDetails"] != null)
            {
                ProductAdminBLL bll = new ProductAdminBLL();

                if (ModelState.IsValid)
                {
                    int res = bll.UpdateBrand(brand);
                    if (res > 0)
                    {
                        return RedirectToAction("Brand");
                    }
                    else
                    {
                        return View();
                    }


                }
                else
                {
                    return View();
                }

            }
            else
            {
                return RedirectToAction("Error");
            }

        }
Example #2
0
        public ActionResult CreateBrand_Post()
        {
            Session["ControllerName"] = "Create Brand";
            if (Session["loginDetails"] != null)
            {
                if (ModelState.IsValid)
                {
                    Brand brand = new Brand();
                    TryUpdateModel<Brand>(brand);

                    ProductAdminBLL bll = new ProductAdminBLL();
                    int res = bll.InsertBrand(brand);
                    if (res > 0)
                    {
                       return RedirectToAction("Brand");
                    }

                }

                return View();

                
            }
            else
            {
                return RedirectToAction("Error");
            }
        }