public ActionResult Create(MortgageAccount mortgageaccount)
        {
            mortgageaccount.SetNextAccountNumber();
            if (ModelState.IsValid)
            {
                db.MortgageAccounts.Add(mortgageaccount);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.ClientId = new SelectList(db.Clients, "ClientId", "FullName", mortgageaccount.ClientId);
            ViewBag.AccountStatusId = new SelectList(db.AccountStatuses, "AccountStatusId", "Description", mortgageaccount.AccountStatusId);
            return View(mortgageaccount);
        }
 public ActionResult Edit(MortgageAccount mortgageaccount)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mortgageaccount).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.ClientId = new SelectList(db.Clients, "ClientId", "FullName", mortgageaccount.ClientId);
     ViewBag.AccountStatusId = new SelectList(db.AccountStatuses, "AccountStatusId", "Description", mortgageaccount.AccountStatusId);
     return View(mortgageaccount);
 }