public ActionResult Register()
        {
            var rols = (byte[])Session["rols"];

            if (rols == null) //redirect to SinIn
            {
                return(RedirectToAction("Index", "Home"));
            }
            else if (rols.Contains <byte>(1))
            {
                categories _categories = new categories();
                ViewBag.Categories = _categories.GetAll();
                return(View());
            }
            else//redirect to Home
            {
                return(RedirectToAction("Home", "Home"));
            }
        }
        public ActionResult Update(long id)
        {
            var rols = (byte[])Session["rols"];

            if (rols == null) //redirect to SinIn
            {
                return(RedirectToAction("Index", "Home"));
            }
            else if (rols.Contains <byte>(1))
            {
                categories _categories = new categories();
                ViewBag.Categories = _categories.GetAll();

                var product = _products.GetOneById(id);
                return(View(product));
            }
            else//redirect to Home
            {
                return(RedirectToAction("Home", "Home"));
            }
        }
Exemple #3
0
        public ActionResult Update()
        {
            var listCategories = _categories.GetAll();

            return(View(listCategories));
        }