Beispiel #1
0
        public ActionResult EditCategory(Category_Course cate)
        {
            QLDaiHocEntities1 db       = new QLDaiHocEntities1();
            Category_Course   category = new Category_Course();

            category.CategoryID      = cate.CategoryID;
            category.Category_Name   = cate.Category_Name;
            category.Description     = cate.Description;
            db.Entry(category).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("StaffMana", "StaffPage"));
        }
Beispiel #2
0
 public ActionResult AddCategory(Category_Course cate)
 {
     using (QLDaiHocEntities1 db = new QLDaiHocEntities1())
     {
         if (ModelState.IsValid)
         {
             db.Category_Course.Add(cate);
             db.SaveChanges();
             return(RedirectToAction("StaffMana", "StaffPage"));
         }
     }
     return(View());
 }