Exemplo n.º 1
0
        private async Task <EFCommandResponse> SendReceipt(EFIReceipt receipt, bool showRequest)
        {
            EFCommandResponse result = null;

            EnableControls(false);
            if (showRequest)
            {
                DisplayRequest(receipt);
            }

            try
            {
                //var model = receipt.ToXMLModel();
                //var json=model.ToJson();
                result = await _fiscalApiService.CreateReceipt(receipt);

                SaveRequestAndResponseIfRequired(@"Logs\Receipts\", receipt.ToXMLModel(), result, chkSaveToXml.Checked);
                result.Url.UrlContent = result.Url.ToModel();
                DisplayResponse(result);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
            EnableControls(true);
            return(result);
        }
 public async Task <EFCommandResponse> CreateReceipt(EFIReceipt command)
 {
     return(await CreateReceipt(command.ToXMLModel()));
 }