public LastSaleResponse LastSale()
 {
     if (_configured)
     {
         try
         {
             LastSaleResponse response = new LastSaleResponse(TransbankWrap.last_sale());
             if (response.Success)
             {
                 return(response);
             }
             else
             {
                 throw new TransbankLastSaleException("LastSale returned an error: " + response.ResponseMessage, response);
             }
         }
         catch (TransbankLastSaleException)
         {
             throw;
         }
         catch (Exception e)
         {
             throw new TransbankException("Unable to execute LastSale on pos", e);
         }
     }
     else
     {
         throw new TransbankException("Port not Configured");
     }
 }
 private void lastSaleToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         LastSaleResponse response = POS.Instance.LastSale();
         if (response.Success)
         {
             MessageBox.Show(response.ToString(), "Last Sale obtained Successfully.");
         }
     }
     catch (TransbankException a)
     {
         MessageBox.Show(a.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 public TransbankLastSaleException(string message, LastSaleResponse response) : base(message)
 {
     LastSaleResponse = response;
 }
 public TransbankMultiCodeLastSaleException(string message, LastSaleResponse response) : base(message, response)
 {
 }