Beispiel #1
0
 public static void RefreshAffichage()
 {
     TxtPrenom.Text       = "Prénom: " + OpererFactureController.LaFacture.LeClient.Prenom;
     TxtNom.Text          = "Nom: " + OpererFactureController.LaFacture.LeClient.Nom;
     TxtEscompte.Text     = "Escompte: " + OpererFactureController.LaFacture.LeClient.Rang.Escompte.ToString() + " %";
     TxtSousTotal.Text    = OpererFactureController.CalculerSousTotal().ToString("c2");
     TxtTPS.Text          = OpererFactureController.CalculerTps().ToString("c2");
     TxtTVQ.Text          = OpererFactureController.CalculerTvq().ToString("c2");
     TxtTotal.Text        = OpererFactureController.CalculerTotal().ToString("c2");
     TxtEscomptePrix.Text = OpererFactureController.CalculerEscompte(OpererFactureController.LaFacture.LeClient.Rang.Escompte).ToString("c2");
 }
Beispiel #2
0
        private void AjouteTablePied()
        {
            tablePied = new PdfPTable(2)
            {
                WidthPercentage = 100, SpacingBefore = 25
            };
            tablePied.DefaultCell.Padding             = 0;
            tablePied.DefaultCell.HorizontalAlignment = Element.ALIGN_RIGHT;
            tablePied.DefaultCell.Border = Rectangle.NO_BORDER;

            List <string> labels = new List <string> {
                "Sous-total", "Escompte", "TPS", "TVQ", "Total"
            };
            List <string> montants = new List <string>
            {
                OpererFactureController.CalculerSousTotal().ToString("0.00"),
                OpererFactureController.CalculerEscompte(facture.LeClient.Rang.Escompte).ToString("0.00"),
                OpererFactureController.CalculerTps().ToString("0.00"),
                OpererFactureController.CalculerTvq().ToString("0.00"),
                OpererFactureController.CalculerTotal().ToString("0.00")
            };

            for (int i = 0; i < 5; ++i)
            {
                PdfPCell cellLabel = new PdfPCell(new Phrase(labels[i]));
                cellLabel.Padding             = 5;
                cellLabel.HorizontalAlignment = Element.ALIGN_RIGHT;
                cellLabel.Border = Rectangle.NO_BORDER | Rectangle.BOTTOM_BORDER;
                tablePied.AddCell(cellLabel);

                PdfPCell cellMontant = new PdfPCell(new Phrase($"{montants[i]} $"));
                cellMontant.Padding             = 5;
                cellMontant.HorizontalAlignment = Element.ALIGN_RIGHT;
                cellMontant.Border = Rectangle.NO_BORDER | Rectangle.BOTTOM_BORDER;
                tablePied.AddCell(cellMontant);
            }

            document.Add(tablePied);
        }