Beispiel #1
0
        public string InsertPaymentType(InsertPaymentType obj)
        {
            string returnResult = (dynamic)null;

            try
            {
                if (obj != null)
                {
                    //[Note: insert 'states' table]
                    if (obj.PaymentTypes != null)
                    {
                        var PaymentTypes = new InsertPaymentTypet_PaymentTypes()
                        {
                            Name = obj.PaymentTypes.Name
                        };
                        _PaymentTypesRepo.Insert(PaymentTypes);
                        returnResult = "Saved";
                    }
                }
            }
            catch (Exception ex)
            {
                returnResult = "ERROR102:ClassesServ/InsertClassessList - " + ex.Message;
            }
            return(returnResult);
        }
Beispiel #2
0
 public async Task <IActionResult> InsertPaymentType(IndexPaymentTypesListVM obj)
 {
     try
     {
         if (obj.PaymentTypes != null)
         {
             var PaymentTypes = new InsertPaymentTypet_PaymentTypes()
             {
                 Name = obj.PaymentTypes.Name
             };
             var model = new InsertPaymentType()
             {
                 PaymentTypes = PaymentTypes
             };
             await Task.Run(() => _PaymentTypesServ.InsertPaymentType(model));
         }
     }
     catch (Exception)
     {
         return(BadRequest());
     }
     return(RedirectToAction("PaymentTypesList"));
 }