Exemple #1
0
        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);
        }
Exemple #2
0
 public void Remove(ChargeCode chargeCode)
 {
     _db.ChargeCodes.Remove(chargeCode);
     _db.SaveChanges();
 }
Exemple #3
0
 public void Update(ChargeCode chargeCode)
 {
     _db.Entry(chargeCode).State = EntityState.Modified;
     _db.SaveChanges();
 }
Exemple #4
0
 public void Add(ChargeCode chargeCode)
 {
     _db.ChargeCodes.Add(chargeCode);
     _db.SaveChanges();
 }