public ActionResult Update(Account model) { var result = _repository.Update(model); if (result) { Alerts.Type = 8; return(RedirectToAction("Index")); } else { Alerts.Type = 7; ViewBag.response = Alerts.Type; return(View(model)); } }
public ActionResult Update(Account model) { var result = _repository.Update(model); if (result) { TempData["response"] = "Cuenta actualizada"; TempData["Icon"] = "success"; } else { TempData["response"] = "Lo sentimos, no se ha actualizado la cuenta"; TempData["Icon"] = "error"; } return(RedirectToAction("Index")); }
public bool Add(Debs entity) { try { _dbContext.Debs.Add(entity); var account = _dbContext.Accounts .Single(x => x.Id == entity.AccountId); account.Total += entity.Money; _Account.Update(account); _dbContext.SaveChanges(); return(true); } catch (Exception) { return(false); throw; } }