public virtual void OnExportInvokedEnd(List <InvoiceItem> data, string fileType, string fileName)
        {
            ExportInvokedEventArgs e = new ExportInvokedEventArgs {
                Data = data, FileType = fileType, FileName = fileName
            };

            ExportInvokedEnd?.Invoke(this, e);
        }
Ejemplo n.º 2
0
        public void HandleExportInvoked(object sender, ExportInvokedEventArgs e)
        {
            try
            {
                using (System.IO.StreamWriter file = new System.IO.StreamWriter(e.FileName, false))
                {
                    file.WriteLine("!Type:CCard");
                    foreach (var r in e.Data)
                    {
                        file.WriteLine("D{0}", r.ValorReal >= 0 ? r.Vencimento.ToString("dd/MM/yyyy") : r.Data.ToString("dd/MM/yyyy"));
                        file.WriteLine("T{0}{1}", r.ValorReal >= 0 ? "-" : "+", Math.Abs(r.ValorReal).ToString(nfi));
                        file.WriteLine("P{0}", r.Beneficiario);
                        file.WriteLine("M{0}", r.Data.ToString("dd/MM/yyyy"));
                        file.WriteLine("^");
                    }
                }

                ((InvoiceEventAggregator)sender).OnExportInvokedEnd(e.Data, e.FileType, e.FileName);
            }
            catch (Exception)
            {
                //TODO: Bug Hidden
            }
        }