/// <summary>
 /// Function : fncAdd(clsClient client) -> adds a customer in the Clients list
 /// </summary>
 /// <param name="client"></param>
 /// <returns>ListClients.Add(client.vIdClient, client) or false</returns>
 public bool fncAdd(clsClient client)
 {
     if (!fncExist(client.vNumber))
     {
         ListClients.Add(client.vNumber, client);
         return(true);
     }
     else
     {
         return(false);
     }
 }
 public void fncWriteDocumentPdf()
 {
     try
     {
         clsClient actualClient = frmBank.fncActualClient();
         Document  doc          = new Document(iTextSharp.text.PageSize.LETTER, 100, 100, 50, 50);
         PdfWriter writingPdf   = PdfWriter.GetInstance(doc, new FileStream("NB_Sdp_Consult.pdf", FileMode.Create));
         doc.Open(); // Open document to write
         DateTime  today     = clsDataSource.fncTodayDate();
         Paragraph paregraph = new Paragraph("National Bank of Canada : " + "\n" + "Date : " + today.ToString() + "\n" + "CONSULT." + "\n" + actualClient.fncDisplayHuman());
         doc.Add(paregraph);
         doc.Close(); // Close document
         MessageBox.Show("a PDF has been written");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Inherited function
 /// </summary>
 public void fncWriteDocumentPdf()
 {
     try
     {
         clsClient actualClient = frmBank.fncActualClient();
         Document  doc          = new Document(iTextSharp.text.PageSize.LETTER, 100, 100, 50, 50);
         PdfWriter writingPdf   = PdfWriter.GetInstance(doc, new FileStream("NB_Sdp_Withdraw.pdf", FileMode.Create));
         doc.Open(); // Open document to write
         DateTime today = clsDataSource.fncTodayDate();
         // Written text in to the pdf
         Paragraph paregraph = new Paragraph("National Bank of Canada : " + "\n" + "Date : " + today.ToString() + "\n" + "WITHDRAW." + "\n" + actualClient.fncDisplayHuman());
         doc.Add(paregraph);
         doc.Close(); // Close document
         MessageBox.Show("a PDF has been written");
         // How to automatically open ITextSharp PDF after creating file
         System.Diagnostics.Process.Start("D:\\10.Portafolio\\prjWin_NationalBank_Rm\\prjWin_Strategy-Design-Pattern_Rm\\bin\\Debug\\NB_Sdp_Withdraw.pdf");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }