Exemplo n.º 1
0
        public string UpdatePaymentType(UpdatePaymentType obj)
        {
            string returnResult = (dynamic)null;

            try
            {
                if (obj != null)
                {
                    if (obj.PaymentTypes != null)
                    {
                        var PaymentTypes = new UpdatePaymentType_PaymentTypes()
                        {
                            Id   = obj.PaymentTypes.Id,
                            Name = obj.PaymentTypes.Name
                        };
                        _PaymentTypesRepo.Update(PaymentTypes);
                        returnResult = "Saved";
                    }
                }
            }
            catch (Exception ex)
            {
                returnResult = "ERROR102:AddressesServ/UpdateAddress - " + ex.Message;
            }
            return(returnResult);
        }
Exemplo n.º 2
0
 public async Task <IActionResult> UpdatePaymentType(IndexPaymentTypesListVM obj)
 {
     try
     {
         if (obj.PaymentTypes != null)
         {
             var PaymentTypes = new Vm_PaymentTypes()
             {
                 Id   = obj.PaymentTypes.Id,
                 Name = obj.PaymentTypes.Name
             };
             var model = new UpdatePaymentType()
             {
                 PaymentTypes = PaymentTypes
             };
             await Task.Run(() => _PaymentTypesServ.UpdatePaymentType(model));
         }
     }
     catch (Exception)
     {
         return(BadRequest());
     }
     return(RedirectToAction("PaymentTypesList"));
 }