public ActionResult CategoryEdit(WorkCategory workCategory)
        {
            db.Database.ExecuteSqlCommand("UPDATE WorkCategories SET Name = {0}, OrderBy = {1} WHERE WorkCategoryId = {2}", workCategory.Name, workCategory.OrderBy, workCategory.WorkCategoryId);

            return RedirectToAction("CategoryIndex");
            //if (ModelState.IsValid)
            //{
            //    db.Entry(workCategory).State = EntityState.Modified;
            //    db.SaveChanges();
            //    return RedirectToAction("CategoryIndex");
            //}

            //return View(workCategory);
        }
 public void UpdateCategoryGrid(WorkCategory workCategory)
 {
     db.Database.ExecuteSqlCommand("UPDATE WorkCategories SET Name = {0}, OrderBy = {1} WHERE WorkCategoryId = {2}", workCategory.Name, workCategory.OrderBy, workCategory.WorkCategoryId);
 }
        public ActionResult CategoryCreate(WorkCategory workCategory)
        {
            if (ModelState.IsValid)
            {
                db.Categories.Add(workCategory);
                db.SaveChanges();
                return RedirectToAction("CategoryIndex");
            }

            return View(workCategory);
        }