Ejemplo n.º 1
0
        public ActionResult Create(VoucherType vt)
        {
            string msg = "Failed To add Voucher Type";
            if (vtService.AddVoucherType(vt))
                msg = "Successfully added.";

            ModelState.AddModelError("msg",msg);

            return RedirectToAction("Index");
        }
Ejemplo n.º 2
0
 public bool AddVoucherType(VoucherType voucherType)
 {
     try
     {
         voucherType.State = ObjectState.Added;
         voucherRep.AddOperation(voucherType);
         voucherType.State = ObjectState.Unchanged;
         return true;
     }
     catch (Exception ex)
     {
         var rr = ex.Message;
         return false;
     }
 }