public ActionResult Create(GeneralLedger generalledger) { if (ModelState.IsValid) { db.GeneralLedgers.Add(generalledger); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.IdChartOfAccount = new SelectList(db.ChartOfAccounts, "IdChartOfAccount", "NumChartOfAccount", generalledger.IdChartOfAccount); return View(generalledger); }
public ActionResult Edit(GeneralLedger generalledger) { if (ModelState.IsValid) { db.Entry(generalledger).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.IdChartOfAccount = new SelectList(db.ChartOfAccounts, "IdChartOfAccount", "NumChartOfAccount", generalledger.IdChartOfAccount); return View(generalledger); }