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