Пример #1
0
        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
        {
            if (e.Property == ValeurDP)
            {
                String Objet         = "";
                String Propriete     = "";
                String TypePropriete = "";

                if (InfosBinding(e.Property, ref Objet, ref Propriete, ref TypePropriete))
                {
                    String ToolTip = DicIntitules.Info(Objet, Propriete);
                    if (!String.IsNullOrWhiteSpace(ToolTip))
                    {
                        xBase.ToolTip = ToolTip;
                    }
                }
            }

            base.OnPropertyChanged(e);
        }
        public FlowDocument Impression()
        {
            FlowDocument Doc = new FlowDocument();

            Societe pS = Client.Societe;

            Doc.FontFamily = new FontFamily("Calibri");

            Table         Tprincipale;
            Table         T;
            TableColumn   C;
            TableRowGroup RgPrincipal;
            TableRowGroup Rg;
            TableRow      R1;
            TableRow      R2;
            TableRow      R3;
            TableRow      R4;
            TableRow      R5;
            TableRow      R6;
            TableRow      R;
            TableRow      Rtmp;
            TableCell     Section;

            Paragraph Pr;

            TableCell     Cl = null;
            Double        FS = 13;
            FontWeight    FW = FontWeights.Normal;
            Thickness     TK = new Thickness(0, 0, 0, 10);
            TextAlignment TA = TextAlignment.Left;

            // Mise en page d'un paragraphe
            Action <Object> PrgThick = delegate(Object Chaine)
            {
                Pr               = new Paragraph(new Run(Chaine.ToString()));
                Pr.FontSize      = FS;
                Pr.FontWeight    = FW;
                Pr.Margin        = TK;
                Pr.TextAlignment = TA;
                Cl.Blocks.Add(Pr);
            };

            Action <Object> Prg = delegate(Object Chaine)
            {
                Pr               = new Paragraph(new Run(Chaine.ToString()));
                Pr.FontSize      = FS;
                Pr.FontWeight    = FW;
                Pr.TextAlignment = TA;
                Cl.Blocks.Add(Pr);
            };


            Tprincipale         = new Table();
            Tprincipale.Padding = new Thickness(0);

            Tprincipale.Columns.Add(new TableColumn());

            RgPrincipal = new TableRowGroup();
            Tprincipale.RowGroups.Add(RgPrincipal);

            Doc.Blocks.Add(Tprincipale);

            //-------------------------------------------

            R1 = new TableRow();
            RgPrincipal.Rows.Add(R1);

            Section                 = new TableCell();
            Section.Padding         = new Thickness(10);
            Section.BorderBrush     = Brushes.Black;
            Section.BorderThickness = new Thickness(1);

            R1.Cells.Add(Section);

            T         = new Table();
            T.Padding = new Thickness(0);
            T.Margin  = new Thickness(0);

            C       = new TableColumn();
            C.Width = new GridLength(20, GridUnitType.Star);
            T.Columns.Add(C);

            C       = new TableColumn();
            C.Width = new GridLength(10, GridUnitType.Star);
            T.Columns.Add(C);

            Rg = new TableRowGroup();
            T.RowGroups.Add(Rg);

            R = new TableRow();
            Rg.Rows.Add(R);

            Cl         = new TableCell();
            Cl.Padding = new Thickness(0, 0, 10, 0);

            FS = 24; FW = FontWeights.Bold;
            Prg(pS.Statut);

            FS = 16; TK = new Thickness(0, 0, 0, 10);
            PrgThick(pS.Denomination);

            FS = 13;
            Prg(pS.Adresse);

            PrgThick(pS.Cp + " " + pS.Ville);

            Prg(pS.Tel_Mobile);

            Prg(pS.Email);

            R.Cells.Add(Cl);

            Cl                 = new TableCell();
            Cl.Padding         = new Thickness(10, 0, 0, 0);
            Cl.BorderBrush     = Brushes.Black;
            Cl.BorderThickness = new Thickness(1, 0, 0, 0);

            FS = 11; TK = new Thickness(0, 0, 0, 10);
            PrgThick(this.Date.ToString("dd/MM/yyyy"));

            FS = 16; TK = new Thickness(0, 0, 0, 20);
            PrgThick("Devis n°  " + this.Ref);

            FS = 13; TK = new Thickness(0, 0, 0, 10);
            PrgThick(this.Adresse_Client.Intitule);

            Prg(this.Adresse_Client.Adresse);
            Prg(this.Adresse_Client.Cp + " " + this.Adresse_Client.Ville);

            R.Cells.Add(Cl);

            Section.Blocks.Add(T);

            //-------------------------------------------
            Rtmp = new TableRow();
            RgPrincipal.Rows.Add(Rtmp);

            Section         = new TableCell();
            Section.Padding = new Thickness(0);

            Rtmp.Cells.Add(Section);
            //------------------------------------------

            R2 = new TableRow();
            RgPrincipal.Rows.Add(R2);

            Section                 = new TableCell();
            Section.Padding         = new Thickness(10);
            Section.BorderBrush     = Brushes.Black;
            Section.BorderThickness = new Thickness(1);

            R2.Cells.Add(Section);

            Pr            = new Paragraph(new Run("Objet :"));
            Pr.FontSize   = 13;
            Pr.FontWeight = FontWeights.Bold;
            Pr.Margin     = new Thickness(0, 0, 0, 2);
            Section.Blocks.Add(Pr);

            Pr            = new Paragraph(new Run(this.Description));
            Pr.FontSize   = 13;
            Pr.FontWeight = FontWeights.Bold;
            Pr.Padding    = new Thickness(10, 0, 0, 0);
            Section.Blocks.Add(Pr);

            if (!String.IsNullOrWhiteSpace(this.Info))
            {
                R3 = new TableRow();
                RgPrincipal.Rows.Add(R3);

                Section                 = new TableCell();
                Section.Padding         = new Thickness(10);
                Section.BorderBrush     = Brushes.Black;
                Section.BorderThickness = new Thickness(1);

                R3.Cells.Add(Section);

                Pr            = new Paragraph(new Run(this.Info));
                Pr.FontSize   = 13;
                Pr.FontWeight = FontWeights.Bold;
                Pr.Padding    = new Thickness(10, 0, 0, 0);
                Section.Blocks.Add(Pr);
            }

            R4 = new TableRow();
            RgPrincipal.Rows.Add(R4);

            Section                 = new TableCell();
            Section.Padding         = new Thickness(10);
            Section.BorderBrush     = Brushes.Black;
            Section.BorderThickness = new Thickness(1);

            R4.Cells.Add(Section);

            foreach (Poste P in this.ListePoste)
            {
                if (!P.Statut)
                {
                    continue;
                }

                Pr                 = new Paragraph(new Run(P.Titre));
                Pr.FontSize        = 16;
                Pr.FontWeight      = FontWeights.Bold;
                Pr.TextDecorations = TextDecorations.Underline;
                Pr.Margin          = new Thickness(0, 0, 0, 5);
                Section.Blocks.Add(Pr);

                T         = new Table();
                T.Padding = new Thickness(0);
                T.Margin  = new Thickness(0, 0, 0, 30);

                C       = new TableColumn();
                C.Width = new GridLength(40, GridUnitType.Star);
                T.Columns.Add(C);

                C       = new TableColumn();
                C.Width = new GridLength(15, GridUnitType.Star);
                T.Columns.Add(C);

                Rg = new TableRowGroup();
                T.RowGroups.Add(Rg);



                R = new TableRow();
                Rg.Rows.Add(R);

                Cl         = new TableCell();
                Cl.Padding = new Thickness(10, 0, 10, 0);

                FS = 13; FW = FontWeights.Normal; TK = new Thickness(0, 0, 0, 5);
                Prg(P.Description);

                R.Cells.Add(Cl);

                Cl                 = new TableCell();
                Cl.Padding         = new Thickness(10, 0, 0, 0);
                Cl.BorderBrush     = Brushes.Black;
                Cl.BorderThickness = new Thickness(1, 0, 0, 0);
                Cl.TextAlignment   = TextAlignment.Right;

                FS = 13; FW = FontWeights.Normal; TK = new Thickness(0, 0, 0, 5); TA = TextAlignment.Right;

                if (P.Qte != 1)
                {
                    String pUnite = P.Unite;
                    if (!String.IsNullOrWhiteSpace(pUnite))
                    {
                        pUnite = "\\" + pUnite;
                    }

                    Prg(DicIntitules.Intitule("Poste", "Qte") + " : " + P.Qte + " " + P.Unite);
                    Prg(DicIntitules.Intitule("Poste", "Prix_Unitaire") + " : " + P.Prix_Unitaire + " " + DicIntitules.Unite("Poste", "Prix_Unitaire") + pUnite);
                }

                FS = 15; FW = FontWeights.Bold;
                if (P.Qte != 1)
                {
                    Prg("Total : " + P.Prix_Ht + " " + DicIntitules.Unite("Poste", "Prix_Ht"));
                }
                else
                {
                    Prg(P.Prix_Ht + " " + DicIntitules.Unite("Poste", "Prix_Ht"));
                }

                TA = TextAlignment.Left;

                Cl.Blocks.Add(Pr);

                R.Cells.Add(Cl);

                Section.Blocks.Add(T);
            }

            R5 = new TableRow();
            RgPrincipal.Rows.Add(R5);

            Section                 = new TableCell();
            Section.Padding         = new Thickness(10);
            Section.BorderBrush     = Brushes.Black;
            Section.BorderThickness = new Thickness(1);

            R5.Cells.Add(Section);

            T         = new Table();
            T.Padding = new Thickness(0);
            T.Margin  = new Thickness(0);

            C       = new TableColumn();
            C.Width = new GridLength(20, GridUnitType.Star);
            T.Columns.Add(C);

            C       = new TableColumn();
            C.Width = new GridLength(10, GridUnitType.Star);
            T.Columns.Add(C);

            C       = new TableColumn();
            C.Width = new GridLength(5, GridUnitType.Star);
            T.Columns.Add(C);

            Rg = new TableRowGroup();
            T.RowGroups.Add(Rg);

            R = new TableRow();
            Rg.Rows.Add(R);

            Cl         = new TableCell();
            Cl.Padding = new Thickness(0, 0, 10, 0);



            if (!String.IsNullOrWhiteSpace(this.Conditions))
            {
                FS = 16; FW = FontWeights.Bold; TK = new Thickness(0, 0, 0, 5); TA = TextAlignment.Left;
                PrgThick("Modalités de règlement : ");

                FS = 13; FW = FontWeights.Bold; TK = new Thickness(0, 0, 0, 5);
                Prg(this.Conditions);

                if (this.Acompte != 0)
                {
                    Pr            = new Paragraph(new Run("Acompte de : " + this.Acompte + DicIntitules.Unite("Devis", "Acompte")));
                    Pr.FontSize   = 13;
                    Pr.FontWeight = FontWeights.Bold;
                    Cl.Blocks.Add(Pr);
                }
            }

            R.Cells.Add(Cl);

            Cl                 = new TableCell();
            Cl.Padding         = new Thickness(10, 0, 0, 0);
            Cl.BorderBrush     = Brushes.Black;
            Cl.BorderThickness = new Thickness(1, 0, 0, 0);

            FS = 15; FW = FontWeights.Bold; TK = new Thickness(0, 0, 0, 10); TA = TextAlignment.Left;
            PrgThick(DicIntitules.Intitule("Devis", "Prix_Ht"));

            PrgThick(DicIntitules.Intitule("Devis", "Tva_Pct") + " " + this.Tva_Pct + DicIntitules.Unite("Devis", "Tva_Pct"));

            PrgThick(DicIntitules.Intitule("Devis", "Prix_Ttc"));

            R.Cells.Add(Cl);

            Cl                 = new TableCell();
            Cl.Padding         = new Thickness(10, 0, 0, 0);
            Cl.BorderBrush     = Brushes.Black;
            Cl.BorderThickness = new Thickness(0);

            TA = TextAlignment.Right;
            PrgThick(this.Prix_Ht + DicIntitules.Unite("Devis", "Prix_Ht"));

            PrgThick(this.Tva + DicIntitules.Unite("Devis", "Tva"));

            PrgThick(this.Prix_Ttc + DicIntitules.Unite("Devis", "Prix_Ttc"));

            R.Cells.Add(Cl);

            Section.Blocks.Add(T);

            //------------------------------------------

            R6 = new TableRow();
            RgPrincipal.Rows.Add(R6);

            Section                 = new TableCell();
            Section.Padding         = new Thickness(10);
            Section.BorderBrush     = Brushes.Black;
            Section.BorderThickness = new Thickness(1);

            R6.Cells.Add(Section);

            Pr            = new Paragraph(new Run("BON POUR ACCORD, DATE ET SIGNATURE :"));
            Pr.FontSize   = 16;
            Pr.FontWeight = FontWeights.Bold;
            Pr.Margin     = new Thickness(0, 0, 0, 50);
            Section.Blocks.Add(Pr);

            Pr               = new Paragraph(new Run(pS.Pied));
            Pr.FontSize      = 13;
            Pr.TextAlignment = TextAlignment.Center;
            Section.Blocks.Add(Pr);

            //-------------------------------------------

            return(Doc);
        }
Пример #3
0
        public FlowDocument Impression()
        {
            FlowDocument Doc = new FlowDocument();

            Societe pS = Devis.Client.Societe;

            Doc.FontFamily = new FontFamily("Calibri");

            Table         Tprincipale;
            Table         T;
            TableColumn   C;
            TableRowGroup RgPrincipal;
            TableRowGroup Rg;
            TableRow      R1;
            TableRow      R2;
            TableRow      R3;
            TableRow      R4;
            TableRow      R5;
            TableRow      R6;
            TableRow      R;
            TableRow      Rtmp;
            TableCell     Section;

            Paragraph Pr;

            TableCell     Cl = null;
            Double        FS = 13;
            FontWeight    FW = FontWeights.Normal;
            Thickness     TK = new Thickness(0, 0, 0, 10);
            TextAlignment TA = TextAlignment.Left;

            // Mise en page d'un paragraphe
            Action <Object> PrgThick = delegate(Object Chaine)
            {
                Pr               = new Paragraph(new Run(Chaine.ToString()));
                Pr.FontSize      = FS;
                Pr.FontWeight    = FW;
                Pr.Margin        = TK;
                Pr.TextAlignment = TA;
                Cl.Blocks.Add(Pr);
            };

            Action <Object> Prg = delegate(Object Chaine)
            {
                Pr               = new Paragraph(new Run(Chaine.ToString()));
                Pr.FontSize      = FS;
                Pr.FontWeight    = FW;
                Pr.TextAlignment = TA;
                Cl.Blocks.Add(Pr);
            };


            Tprincipale         = new Table();
            Tprincipale.Padding = new Thickness(0);

            Tprincipale.Columns.Add(new TableColumn());

            RgPrincipal = new TableRowGroup();
            Tprincipale.RowGroups.Add(RgPrincipal);

            Doc.Blocks.Add(Tprincipale);

            //-------------------------------------------

            R1 = new TableRow();
            RgPrincipal.Rows.Add(R1);

            Section                 = new TableCell();
            Section.Padding         = new Thickness(10);
            Section.BorderBrush     = Brushes.Black;
            Section.BorderThickness = new Thickness(1);

            R1.Cells.Add(Section);

            T         = new Table();
            T.Padding = new Thickness(0);
            T.Margin  = new Thickness(0);

            C       = new TableColumn();
            C.Width = new GridLength(20, GridUnitType.Star);
            T.Columns.Add(C);

            C       = new TableColumn();
            C.Width = new GridLength(10, GridUnitType.Star);
            T.Columns.Add(C);

            Rg = new TableRowGroup();
            T.RowGroups.Add(Rg);

            R = new TableRow();
            Rg.Rows.Add(R);

            Cl         = new TableCell();
            Cl.Padding = new Thickness(0, 0, 10, 0);

            FS = 24; FW = FontWeights.Bold;
            Prg(pS.Statut);

            FS = 16; TK = new Thickness(0, 0, 0, 10);
            PrgThick(pS.Denomination);

            FS = 13;
            Prg(pS.Adresse);

            PrgThick(pS.Cp + " " + pS.Ville);

            Prg(pS.Tel_Mobile);

            Prg(pS.Email);

            R.Cells.Add(Cl);

            Cl                 = new TableCell();
            Cl.Padding         = new Thickness(10, 0, 0, 0);
            Cl.BorderBrush     = Brushes.Black;
            Cl.BorderThickness = new Thickness(1, 0, 0, 0);

            FS = 11; TK = new Thickness(0, 0, 0, 10);
            PrgThick(this.Date.ToString("dd/MM/yyyy"));

            FS = 13; TK = new Thickness(0, 0, 0, 20);
            PrgThick("Devis n°  " + this.Devis.Ref);

            FS = 16; TK = new Thickness(0, 0, 0, 20);
            PrgThick("Facture n°  " + this.Ref);

            FS = 13; TK = new Thickness(0, 0, 0, 10);
            PrgThick(this.Devis.Adresse_Client.Intitule);

            Prg(this.Devis.Adresse_Client.Adresse);
            Prg(this.Devis.Adresse_Client.Cp + " " + this.Devis.Adresse_Client.Ville);

            R.Cells.Add(Cl);

            Section.Blocks.Add(T);

            //-------------------------------------------
            Rtmp = new TableRow();
            RgPrincipal.Rows.Add(Rtmp);

            Section         = new TableCell();
            Section.Padding = new Thickness(0);

            Rtmp.Cells.Add(Section);
            //------------------------------------------

            R2 = new TableRow();
            RgPrincipal.Rows.Add(R2);

            Section                 = new TableCell();
            Section.Padding         = new Thickness(10);
            Section.BorderBrush     = Brushes.Black;
            Section.BorderThickness = new Thickness(1);

            R2.Cells.Add(Section);

            Pr            = new Paragraph(new Run("Objet :"));
            Pr.FontSize   = 13;
            Pr.FontWeight = FontWeights.Bold;
            Pr.Margin     = new Thickness(0, 0, 0, 10);
            Section.Blocks.Add(Pr);

            Pr            = new Paragraph(new Run(Devis.Description));
            Pr.FontSize   = 13;
            Pr.FontWeight = FontWeights.Bold;
            Pr.Padding    = new Thickness(10, 0, 0, 0);
            Section.Blocks.Add(Pr);

            if (this.Imprimer_Commentaires && !String.IsNullOrWhiteSpace(this.Commentaires))
            {
                R2 = new TableRow();
                RgPrincipal.Rows.Add(R2);

                Section                 = new TableCell();
                Section.Padding         = new Thickness(10);
                Section.BorderBrush     = Brushes.Black;
                Section.BorderThickness = new Thickness(1);

                R2.Cells.Add(Section);

                Pr            = new Paragraph(new Run(this.Commentaires));
                Pr.FontSize   = 13;
                Pr.FontWeight = FontWeights.Bold;
                Pr.Padding    = new Thickness(10, 0, 0, 0);
                Section.Blocks.Add(Pr);
            }


            //-------------------------------------------
            //Rtmp = new TableRow();
            //RgPrincipal.Rows.Add(Rtmp);

            //Section = new TableCell();
            //Section.Padding = new Thickness(0);

            //Rtmp.Cells.Add(Section);
            //------------------------------------------

            if (!String.IsNullOrWhiteSpace(Devis.Info))
            {
                R3 = new TableRow();
                RgPrincipal.Rows.Add(R3);

                Section                 = new TableCell();
                Section.Padding         = new Thickness(10);
                Section.BorderBrush     = Brushes.Black;
                Section.BorderThickness = new Thickness(1);

                R3.Cells.Add(Section);

                Pr            = new Paragraph(new Run(Devis.Info));
                Pr.FontSize   = 13;
                Pr.FontWeight = FontWeights.Bold;
                Pr.Padding    = new Thickness(10, 0, 0, 0);
                Section.Blocks.Add(Pr);
            }

            //-------------------------------------------
            //Rtmp = new TableRow();
            //RgPrincipal.Rows.Add(Rtmp);

            //Section = new TableCell();
            //Section.Padding = new Thickness(0);

            //Rtmp.Cells.Add(Section);
            //------------------------------------------

            R4 = new TableRow();
            RgPrincipal.Rows.Add(R4);

            Section                 = new TableCell();
            Section.Padding         = new Thickness(10);
            Section.BorderBrush     = Brushes.Black;
            Section.BorderThickness = new Thickness(1);

            R4.Cells.Add(Section);

            foreach (Ligne_Facture L in this.ListeLigneFacture)
            {
                if (L.Statut)
                {
                    TA = TextAlignment.Left;

                    Poste P = L.Poste;

                    Pr                 = new Paragraph(new Run(P.Titre));
                    Pr.FontSize        = 16;
                    Pr.FontWeight      = FontWeights.Bold;
                    Pr.TextDecorations = TextDecorations.Underline;
                    Pr.Margin          = new Thickness(0, 0, 0, 10);
                    Section.Blocks.Add(Pr);

                    T         = new Table();
                    T.Padding = new Thickness(0);
                    T.Margin  = new Thickness(0, 0, 0, 30);

                    C       = new TableColumn();
                    C.Width = new GridLength(40, GridUnitType.Star);
                    T.Columns.Add(C);

                    C       = new TableColumn();
                    C.Width = new GridLength(10, GridUnitType.Star);
                    T.Columns.Add(C);

                    Rg = new TableRowGroup();
                    T.RowGroups.Add(Rg);

                    R = new TableRow();
                    Rg.Rows.Add(R);

                    Cl         = new TableCell();
                    Cl.Padding = new Thickness(0, 0, 10, 0);

                    if (L.Imprimer_Description)
                    {
                        FS = 13; FW = FontWeights.Normal; TK = new Thickness(0, 0, 0, 10);
                        Prg(P.Description);
                    }

                    if (!String.IsNullOrWhiteSpace(L.Description))
                    {
                        FS = 13; FW = FontWeights.Normal; TK = new Thickness(0, 0, 0, 10);
                        Prg(L.Description);
                    }

                    R.Cells.Add(Cl);

                    Cl                 = new TableCell();
                    Cl.Padding         = new Thickness(10, 0, 0, 0);
                    Cl.BorderBrush     = Brushes.Black;
                    Cl.BorderThickness = new Thickness(1, 0, 0, 0);
                    Cl.TextAlignment   = TextAlignment.Right;

                    TA = TextAlignment.Right;
                    FS = 15; FW = FontWeights.Bold;

                    switch (L.CalculLigne_Facture)
                    {
                    case CalculLigne_Facture_e.cQuantite:
                        if (L.Qte != 1)
                        {
                            FS = 13; FW = FontWeights.Normal;
                            Prg(DicIntitules.Intitule("Ligne_Facture", "Qte") + " : " + L.Qte + " " + L.Unite);

                            Prg(DicIntitules.Intitule("Ligne_Facture", "Ht_Unitaire") + " : " + L.Ht_Unitaire + " " + DicIntitules.Unite("Ligne_Facture", "Ht_Unitaire"));
                        }

                        FS = 15; FW = FontWeights.Bold;
                        if (L.Qte != 1)
                        {
                            Prg("Total : " + L.Ht + " " + DicIntitules.Unite("Ligne_Facture", "Ht"));
                        }
                        else
                        {
                            Prg(L.Ht + " " + DicIntitules.Unite("Ligne_Facture", "Ht"));
                        }
                        break;

                    case CalculLigne_Facture_e.cPourcentageUnitaire:
                        FS = 13; FW = FontWeights.Normal;
                        Prg(DicIntitules.Intitule("Ligne_Facture", "Ht_Unitaire") + " : " + L.Ht_Unitaire + " " + DicIntitules.Unite("Ligne_Facture", "Ht_Unitaire"));
                        Prg(DicIntitules.Intitule("Ligne_Facture", "Qte") + " : " + L.Qte + " " + L.Unite);

                        FS = 15; FW = FontWeights.Bold;
                        Prg("Total : " + L.Ht + " " + DicIntitules.Unite("Ligne_Facture", "Ht"));

                        break;

                    case CalculLigne_Facture_e.cPourcentageTotal:
                        FS = 13; FW = FontWeights.Normal;
                        Prg(DicIntitules.Intitule("Ligne_Facture", "Ht") + " : " + L.Ht_Unitaire + " " + DicIntitules.Unite("Ligne_Facture", "Ht"));
                        Prg(DicIntitules.Intitule("Ligne_Facture", "Qte") + " : " + L.Qte + " " + L.Unite);

                        FS = 15; FW = FontWeights.Bold;
                        Prg("Total : " + L.Ht + " " + DicIntitules.Unite("Ligne_Facture", "Ht"));

                        break;

                    default:
                        break;
                    }

                    TA = TextAlignment.Left;

                    R.Cells.Add(Cl);

                    Section.Blocks.Add(T);
                }
            }

            //-------------------------------------------
            //Rtmp = new TableRow();
            //RgPrincipal.Rows.Add(Rtmp);

            //Section = new TableCell();
            //Section.Padding = new Thickness(0);

            //Rtmp.Cells.Add(Section);
            //------------------------------------------

            R5 = new TableRow();
            RgPrincipal.Rows.Add(R5);

            Section                 = new TableCell();
            Section.Padding         = new Thickness(10);
            Section.BorderBrush     = Brushes.Black;
            Section.BorderThickness = new Thickness(1);

            R5.Cells.Add(Section);

            T         = new Table();
            T.Padding = new Thickness(0);
            T.Margin  = new Thickness(0);

            C       = new TableColumn();
            C.Width = new GridLength(20, GridUnitType.Star);
            T.Columns.Add(C);

            C       = new TableColumn();
            C.Width = new GridLength(10, GridUnitType.Star);
            T.Columns.Add(C);

            C       = new TableColumn();
            C.Width = new GridLength(5, GridUnitType.Star);
            T.Columns.Add(C);

            Rg = new TableRowGroup();
            T.RowGroups.Add(Rg);

            R = new TableRow();
            Rg.Rows.Add(R);

            Cl         = new TableCell();
            Cl.Padding = new Thickness(0, 0, 10, 0);

            if (!String.IsNullOrWhiteSpace(this.Conditions))
            {
                FS = 16; FW = FontWeights.Bold; TK = new Thickness(0, 0, 0, 5); TA = TextAlignment.Left;
                PrgThick("Modalités de règlement : ");

                FS = 13; FW = FontWeights.Bold; TK = new Thickness(0, 0, 0, 5);
                Prg(this.Conditions);
            }

            R.Cells.Add(Cl);

            Cl                 = new TableCell();
            Cl.Padding         = new Thickness(10, 0, 0, 0);
            Cl.BorderBrush     = Brushes.Black;
            Cl.BorderThickness = new Thickness(1, 0, 0, 0);

            FS = 15; FW = FontWeights.Bold; TK = new Thickness(0, 0, 0, 10); TA = TextAlignment.Left;
            PrgThick(DicIntitules.Intitule("Facture", "Prix_Ht"));

            PrgThick(DicIntitules.Intitule("Devis", "Tva_Pct") + " " + Devis.Tva_Pct + DicIntitules.Unite("Devis", "Tva_Pct"));

            PrgThick(DicIntitules.Intitule("Facture", "Prix_Ttc"));

            R.Cells.Add(Cl);

            Cl                 = new TableCell();
            Cl.Padding         = new Thickness(10, 0, 0, 0);
            Cl.BorderBrush     = Brushes.Black;
            Cl.BorderThickness = new Thickness(0);

            TA = TextAlignment.Right;
            PrgThick(this.Prix_Ht + DicIntitules.Unite("Facture", "Prix_Ht"));

            PrgThick(this.Tva + DicIntitules.Unite("Facture", "Tva"));

            PrgThick(this.Prix_Ttc + DicIntitules.Unite("Facture", "Prix_Ttc"));

            R.Cells.Add(Cl);

            Section.Blocks.Add(T);

            //------------------------------------------

            R6 = new TableRow();
            RgPrincipal.Rows.Add(R6);

            Section                 = new TableCell();
            Section.Padding         = new Thickness(10);
            Section.BorderBrush     = Brushes.Black;
            Section.BorderThickness = new Thickness(1);

            R6.Cells.Add(Section);

            Pr               = new Paragraph(new Run(pS.Pied));
            Pr.FontSize      = 13;
            Pr.TextAlignment = TextAlignment.Center;
            Section.Blocks.Add(Pr);

            //-------------------------------------------

            return(Doc);
        }
Пример #4
0
        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
        {
            if (e.Property == ValeurDP)
            {
                if (Editable)
                {
                    xValeur.Visibility       = System.Windows.Visibility.Visible;
                    xValeur.Background       = Brushes.White;
                    xValeur.IsHitTestVisible = true;
                }
                else
                {
                    xValeur.Visibility       = System.Windows.Visibility.Visible;
                    xValeur.Background       = Brushes.Transparent;
                    xValeur.IsReadOnly       = true;
                    xValeur.BorderThickness  = new Thickness(0);
                    xValeur.IsHitTestVisible = false;
                }

                if (Orientation == System.Windows.Controls.Orientation.Horizontal)
                {
                    DockPanel.SetDock(xIntitule, Dock.Left);
                }
                else
                {
                    DockPanel.SetDock(xIntitule, Dock.Top);
                    xIntitule.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                }

                if (Intitule)
                {
                    xIntitule.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    xIntitule.Visibility = System.Windows.Visibility.Collapsed;
                    xIntitule.Margin     = new Thickness(0);
                    xIntitule.Padding    = new Thickness(0);
                }

                String Objet         = "";
                String Propriete     = "";
                String TypePropriete = "";

                if (InfosBinding(e.Property, ref Objet, ref Propriete, ref TypePropriete))
                {
                    String pIntitule = DicIntitules.Intitule(Objet, Propriete);
                    xIntitule.Text = pIntitule + " :";

                    if (String.IsNullOrWhiteSpace(Valeur.ToString()) && (Editable == false))
                    {
                        xBase.Visibility = System.Windows.Visibility.Collapsed;
                    }

                    String ToolTip = DicIntitules.Info(Objet, Propriete);
                    if (!String.IsNullOrWhiteSpace(ToolTip) && (Info == true))
                    {
                        xBase.ToolTip = ToolTip;
                    }
                }
            }

            base.OnPropertyChanged(e);
        }
Пример #5
0
        private void MajValeur()
        {
            if (Editable)
            {
                xValeur.Visibility       = Visibility.Visible;
                xValeur.Background       = Brushes.White;
                xValeur.IsHitTestVisible = true;
            }
            else
            {
                xValeur.Visibility   = Visibility.Visible;
                xValeur.Background   = Brushes.Transparent;
                xValeur.TextWrapping = TextWrapping;
                //xValeur.IsReadOnly = true;
                xValeur.BorderThickness  = new Thickness(0);
                xValeur.IsHitTestVisible = false;
                if (Unite)
                {
                    xGrille.ColumnDefinitions[0].Width = GridLength.Auto;
                }
            }

            if (Orientation == Orientation.Horizontal)
            {
                DockPanel.SetDock(xIntitule, Dock.Left);
            }
            else
            {
                DockPanel.SetDock(xIntitule, Dock.Top);
                xIntitule.HorizontalAlignment = HorizontalAlignment.Left;
            }

            if (Intitule)
            {
                xIntitule.Visibility = Visibility.Visible;
            }
            else
            {
                xIntitule.Visibility = Visibility.Collapsed;
            }

            if (Unite)
            {
                xUnite.Visibility = Visibility.Visible;
            }
            else
            {
                xUnite.Visibility = Visibility.Collapsed;
            }

            String pIntitule = DicIntitules.Intitule(Valeur_Objet, Valeur_Propriete);

            xIntitule.Text = pIntitule + " :";

            if (Unite)
            {
                _Unite      = DicIntitules.Unite(Valeur_Objet, Valeur_Propriete);
                xUnite.Text = _Unite;
            }

            MajSuffix();

            if (Valeur != null && String.IsNullOrWhiteSpace(Valeur.ToString()) && (Editable == false))
            {
                xBase.Visibility = Visibility.Collapsed;
            }

            String ToolTip = DicIntitules.Info(Valeur_Objet, Valeur_Propriete);

            if (!String.IsNullOrWhiteSpace(ToolTip))
            {
                xBase.ToolTip = ToolTip;
            }

            if (IntituleSeul)
            {
                xGrille.Visibility = System.Windows.Visibility.Collapsed;
            }
        }
Пример #6
0
        private void Supprimer_List <T>(object sender, RoutedEventArgs e, Boolean Message = false, Boolean UnItemMini = false)
            where T : ObjetGestion
        {
            ListBox V; ListeObservable <T> Liste; List <T> Ls; T L;

            if (Info(sender as MenuItem, out V, out Liste, out Ls, out L))
            {
                foreach (T iL in Ls)
                {
                    Boolean Supprimer = !Message;

                    if (Liste.Count >= 1)
                    {
                        if (Message && MessageBox.Show(String.Format("Voulez vous vraiement supprimer : {0} {1} ?", DicIntitules.IntituleType(typeof(T).Name), iL.Ref), "Suppression", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                        {
                            Supprimer = true;
                        }

                        if (Supprimer)
                        {
                            if (UnItemMini == false)
                            {
                                if (iL.Supprimer())
                                {
                                    Liste.Remove(iL);
                                }
                            }
                        }
                    }
                }
                Liste.Numeroter();
            }
        }