public ActionResult UpdatePaymentType(PaymentType paymentToUpdate)
        {
            var paymentType = _paymentRepository.UpdatePaymentType(paymentToUpdate);

            var updatedPaymentType = _paymentRepository.GetSinglePaymentType(paymentToUpdate.PaymentTypeId);

            return(Ok(updatedPaymentType));
        }
Esempio n. 2
0
 public static bool UpdatePaymentType(int id, string type)
 {
     if (PaymentTypeRepository.GetPaymentType(id) != null)
     {
         PaymentTypeRepository.UpdatePaymentType(id, type);
         return(true);
     }
     return(false);
 }
        public void Update(UpdatePaymentTypeCommand updatedPaymentTypeCommand, int id)
        {
            var repo = new PaymentTypeRepository();
            var updatedPaymentType = new PaymentType
            {
                Name = updatedPaymentTypeCommand.Name,
            };

            repo.UpdatePaymentType(updatedPaymentType, id);
        }
        public IActionResult UpdatePaymentType(int id, PaymentType paymentType)
        {
            if (_repo.GetByPaymentTypeId(id) == null)
            {
                return(NotFound());
            }

            var updatedPaymentType = _repo.UpdatePaymentType(id, paymentType);

            return(Ok(updatedPaymentType));
        }
        public IActionResult UpdatePaymentType(int id, PaymentType paymentUpdate)
        {
            var updatePaymentType = _paymentTypeRepo.UpdatePaymentType(id, paymentUpdate);

            if (_paymentTypeRepo.GetSinglePaymentTypeById(id) == null)
            {
                return(NotFound("We don't have a record of anything with this id! Try a different one!"));
            }

            return(Ok(updatePaymentType));
        }
Esempio n. 6
0
 public int UpdatePaymentType(PaymentTypeObject paymentType)
 {
     try
     {
         return(_paymentTypeRepository.UpdatePaymentType(paymentType));
     }
     catch (Exception ex)
     {
         ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message);
         return(-2);
     }
 }
        public ActionResult UpdatePaymentType(PaymentType paymentType)
        {
            var updatedPaymentType = _paymentTypeRepository.UpdatePaymentType(paymentType);

            return(Ok(paymentType));
        }
 public static void GetUpdatePaymentTypeHandler(int id, string name)
 {
     PaymentTypeRepository.UpdatePaymentType(id, name);
 }
Esempio n. 9
0
 public bool UpdatePaymentType(UpdatePaymentTypeCommand updatePaymentTypeCommand, int id)
 {
     updatePaymentTypeCommand.Id = id;
     return(_repo.UpdatePaymentType(updatePaymentTypeCommand, id));
 }