Beispiel #1
0
        public ActionResult UpdCategory(GetAllCategory_Result updCategory, string submit)
        {
            if (submit == "SaveUpd" && action[0] == "UpdCa")
            {
                using (var ef = new LibraryEntities())
                {
                    ef.UpdCategory(Convert.ToInt32(action[1]), updCategory.name);
                }
            }

            return(RedirectToAction("Categories", "Category"));
        }
Beispiel #2
0
        public ActionResult NewCategory(GetAllCategory_Result newCategory, string submit)
        {
            if (submit == "SaveNew")
            {
                using (var ef = new LibraryEntities())
                {
                    ef.InsCategory(newCategory.name);
                }
            }

            return(RedirectToAction("Categories", "Category"));
        }
Beispiel #3
0
        public ActionResult UpdCategory()
        {
            if (action != null)
            {
                var updCategory = new GetAllCategory_Result();

                updCategory = lstCategories.Find(f => f.idCategory == Convert.ToInt32(action[1]));

                return(View(updCategory));
            }

            return(RedirectToAction("Categories", "Category"));
        }