public ActionResult Edit(EditExpenseCategoryModel model) { if (ModelState.IsValid) { _repository.Update(model); return(RedirectToAction("List")); } else { return(View(model)); } }
//using for active and deactive expenseCategory public void SetStatusExpenseCategory(string id) { var expenseCategoryToRemove = _expenseCategoryRepository.Get(c => c.CategoryC == id); if (expenseCategoryToRemove.IsActive == Constants.ACTIVE) { expenseCategoryToRemove.IsActive = Constants.DEACTIVE; } else { expenseCategoryToRemove.IsActive = Constants.ACTIVE; } _expenseCategoryRepository.Update(expenseCategoryToRemove); SaveExpenseCategory(); }
public void UpdateCategory(ExpenseCategory category, string userId) { category.AppUserId = userId; _expenseCategoryRepository.Update(category); }
public Task <int> Update(ExpenseCategoryForm form) { return(_expensecategoryRepository.Update(form)); }