Пример #1
0
        public ActionResult <BaseViewModel <PaymentMethodViewModel> > GetPaymentMethod([CheckGuid(Property = "PaymentMethodId")] string id)
        {
            var result = _locationService.GetPaymentMethod(new Guid(id));

            this.HttpContext.Response.StatusCode = (int)result.StatusCode;

            return(result);
        }
        public async Task <IActionResult> PaymentMethodDetails(int PaymentMethodId)
        {
            try
            {
                var response = await _service.GetPaymentMethod(PaymentMethodId);

                if (response != null)
                {
                    return(Ok(response));
                }
                return(StatusCode(StatusCodes.Status204NoContent));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        public ActionResult Edit(int id)
        {
            if (!_paymentMethodService.DoesPaymentMethodExist(id))
            {
                return(HttpNotFound());
            }

            var paymentMethod = _paymentMethodService.GetPaymentMethod(id);

            var viewModel = new PaymentMethodViewModel
            {
                Heading = "Edit",
                Id      = paymentMethod.Id,
                Cost    = paymentMethod.Cost,
                Name    = paymentMethod.Name,
            };

            return(View("PaymentMethodForm", viewModel));
        }
Пример #4
0
 public IActionResult Get()
 {
     return(Ok(_paymentMethod.GetPaymentMethod()));
 }