public ActionResult Create(AccountCategory accountcategory) { if (ModelState.IsValid) { accountcategoryRepository.InsertOrUpdate(accountcategory); accountcategoryRepository.Save(); return RedirectToAction("Index"); } else { return View(accountcategory); } }
public void InsertOrUpdate(AccountCategory accountcategory) { if (accountcategory.AccountCategoryID == default(int)) { // New entity context.AccountCategory.Add(accountcategory); } else { // Existing entity context.Entry(accountcategory).State = EntityState.Modified; } }
public ActionResult Create() { AccountCategory accountcategory = new AccountCategory(); return View(accountcategory); }
public ViewResult Search(AccountCategory searchAccountCategory) { if(searchAccountCategory!=null) { } return View("Index",accountcategoryRepository.All); }