public IActionResult Remove(TransactionsType aTransactionsType) { bool isRemove = _iTransactionsTypeRepository.Remove(aTransactionsType); if (isRemove) { return(RedirectToAction("Index")); } else { return(ViewBag.ErrorMessage = "Transactions Type remove failed!"); } }
public IActionResult Update(TransactionsType aTransactionsType) { if (ModelState.IsValid) { bool isUpdate = _iTransactionsTypeRepository.Update(aTransactionsType); if (isUpdate) { return(RedirectToAction("Index")); } else { return(ViewBag.ErrorMessage = "Transactions Type update failed!"); } } return(View(aTransactionsType)); }
public IActionResult Update(int?id) { if (HttpContext.Session.GetString("AdminId") != null) { if (id == null) { return(NotFound()); } TransactionsType aTransactionsType = _iTransactionsTypeRepository.GetById(id); if (aTransactionsType == null) { return(NotFound()); } return(View(aTransactionsType)); } else { return(RedirectToAction("Index", "Home")); } }
public Transactions(TransactionsType type, decimal amount) { Type = type; Amount = amount; }