public ActionResult Create(Category category) { try { if (ModelState.IsValid) { _db.Categories.Add(category); _db.SaveChanges(); //return RedirectToAction("Index"); return Content(Boolean.TrueString); } //return View(category); //return PartialView("_Create", category); return Content("Please review your form."); } catch (Exception ex) { return Content("Error Occured!"); } }
public ActionResult Edit(Category category) { try { if (ModelState.IsValid) { _db.Entry(category).State = EntityState.Modified; _db.SaveChanges(); //return RedirectToAction("Index"); return Content(Boolean.TrueString); } //return View(category); //return PartialView("_Edit", category); return Content("Please review your form."); } catch (Exception ex) { return Content("Error Occured!"); } }