Exemple #1
0
        private void btnCalculate_Click(object sender, EventArgs e)
        {
            Logic.Logic          logic    = new Logic.Logic();
            CalculateVatRequest  request  = CreateCalculateVatRequest();
            CalculateVatResponse response = logic.HandleCalculateRequest(request) as CalculateVatResponse;

            if (response != null && response.IsValid)
            {
                //zakładając że chcemy zaokrąglenie
                response.Result = Math.Round(response.Result, 2, MidpointRounding.AwayFromZero);
                tbBrutto.Text   = String.Format("{0:0.##}", response.Result);
            }
            else
            {
                // można też gdzieś wrzucić komunikaty walidacyjne
                tbBrutto.Text = String.Empty;
            }
        }