public ActionResult Create(ChargeCode chargecode) { if (ModelState.IsValid) { _repo.Add(chargecode); return RedirectToAction("Index"); } ViewBag.IdFrequency = new SelectList(_repo.Frequencies, "IdFrequency", "NameFrequency", chargecode.IdFrequency); ViewBag.IdChargeCodeCategory = new SelectList(_repo.ChargeCodeCategories, "IdChargeCodeCategory", "NameChargeCodeCategory", chargecode.IdChargeCodeCategory); ViewBag.IdChargeCodeType = new SelectList(_repo.ChargeCodeTypes, "IdChargeCodeType", "NameChargeCodeType", chargecode.IdChargeCodeType); ViewBag.IdChartOfAccount = new SelectList(_repo.ChartOfAccounts, "IdChartOfAccount", "NumChartOfAccount", chargecode.IdChartOfAccount); ViewBag.IdGeneralLedger = new SelectList(_repo.GeneralLedgers, "IdGeneralLedger", "NameGeneralLedger", chargecode.IdGeneralLedger); return View(chargecode); }
public void Remove(ChargeCode chargeCode) { _db.ChargeCodes.Remove(chargeCode); _db.SaveChanges(); }
public void Update(ChargeCode chargeCode) { _db.Entry(chargeCode).State = EntityState.Modified; _db.SaveChanges(); }
public void Add(ChargeCode chargeCode) { _db.ChargeCodes.Add(chargeCode); _db.SaveChanges(); }