Ejemplo n.º 1
0
        public ActionResult <string> CloseSubscription(string subscriptionId, [FromForm] double amount)
        {
            string result = _subscribeService.CloseSubscription(subscriptionId, amount);

            if (result == null)
            {
                return(Ok("Successfully closed subscription."));
            }
            return(StatusCode(StatusCodes.Status304NotModified, result));
        }
        public void Save()
        {
            SaveCommand.IsEnabled = false;
            IsProgressBarVisible  = true;
            if (!IsValid())
            {
                return;
            }
            string errorMessage = subscribeService.CloseSubscription(SubscriptionId, Amount);

            if (errorMessage == null)
            {
                Amount                = 0;
                SubscriptionId        = "";
                SaveCommand.IsEnabled = false;
                Message               = "Successfully closed subscription";
            }
            else
            {
                Message = errorMessage;
            }
            IsProgressBarVisible = false;
        }