private async void ClearDiscountAsync()
        {
            IsServiceActive = true;

            AppViewModel.ServicesViewModel.CreateServicesTables();
            AppViewModel.DeploymentViewModel.ApplyCredit = null;

            DisplayTotals();
            await PricesGrid.ScrollToAsync(0, PricesGrid.Content.Height, true);

            IsServiceActive = false;
        }
        private async void ButtonDoDiscount_ClickedAsync(object sender, EventArgs e)
        {
            IsServiceActive = true;

            try
            {
                AppViewModel.ServicesViewModel.CreateServicesTables();
                AppViewModel.DeploymentViewModel.ApplyCredit = null;

                if (CreditCode.Text.Length > 0)
                {
                    Credit credit = BaseViewModels.PaymentViewModel.EditCredit;
                    credit.Code = CreditCode.Text.Trim();

                    ResultSingle <Credit> result = await BaseViewModels
                                                   .PaymentViewModel.QueryCreditAsync();

                    if (result.Code == 0)
                    {
                        credit = BaseViewModels.PaymentViewModel.EditCredit;
                        DisplayTotals(credit);
                        AppViewModel
                        .DeploymentViewModel
                        .ApplyCredit = credit;
                    }
                }
                else
                {
                    DisplayTotals();
                }

                await PricesGrid.ScrollToAsync(0, PricesGrid.Content.Height, true);
            }
            catch (Exception ex)
            {
                await ErrorHandler.ExceptionAsync(this, ex);
            }

            IsServiceActive = false;
        }