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