Ejemplo n.º 1
0
        public IActionResult SaveItemCategory(string categoryName)
        {
            if (!(HttpContext.Session.GetString("role") == Enums.EmployeeRole.STORESUPERVISOR || HttpContext.Session.GetString("role") == Enums.EmployeeRole.STOREMANAGER))
            {
                return(RedirectToAction(HttpContext.Session.GetString("role"), "Home"));
            }
            if (categoryName != null)
            {
                invService.CreateCategory(categoryName);
                TempData["alertMsg"] = "Category has been created!";
            }
            else
            {
                TempData["alertMsg"] = "Please enter category name!";
            }

            return(RedirectToAction("AddItemCategory"));
        }