public static void GeneratePM_LAB(IDictionary<LABStudy.SectionEnum, LABStudyModel> dicoLABStudyModel, string pathFileName, bool emptyLAB = false)
        {
            int y = 160;
            int height = 20;
            int width = 500;

            FoxitPDFGenerator pdfGen = new FoxitPDFGenerator();

            LABStudyModel labStudyModel = dicoLABStudyModel[LABStudy.SectionEnum.Client];
            FirmInstitution firmInstitution = labStudyModel.Customer.FirmInstitution;
            var languageData = PageLanguageHelper.GetLanguageContent("User", "LAB_PDF_PM_Report");

            if (emptyLAB)
            {
                labStudyModel = new LABStudyModel();
                firmInstitution = new FirmInstitution();
                labStudyModel.LABStudy = new LABStudy();
                labStudyModel.Customer = new Upsilab.Data.Model.CustomerProspect();
            }

            #region Page 1 : Logo & Title
            //#Page 1 : Title
            //Logo
            string logoPathFileName = Upsilab.Business.Utility.FileManager.BuildLogoPath(firmInstitution.idFirmInstitution) + firmInstitution.Logo;
            pdfGen.AddLogoOnFirstPage(logoPathFileName);

            //Title
            pdfGen.AddReceuil_Title_Center_CalibriBold_Label(languageData.GetContent("Report_Title"), y, width, 100);
            pdfGen.AddReceuil_SubTitle_Center_CalibriBold_Label(languageData.GetContent("Report_Title2"), y += 100, width, height);

            if (emptyLAB)
            {
                string[] rowContents = { string.Format("{0} {1}", languageData.GetContent("Report_Title_Date"), ""),
                                       string.Format("{0}{1}", languageData.GetContent("Report_Title_Reference"), "") };
                pdfGen.AddTableTitle(rowContents, 110, y += 80);
            }
            else
            {
                string[] rowContents = { string.Format("{0} {1}", languageData.GetContent("Report_Title_Date"), labStudyModel.LABStudy.DateUpdated.HasValue ? labStudyModel.LABStudy.DateUpdated.Value.ToShortDateString() : labStudyModel.LABStudy.DateCreated.ToShortDateString()),
                                       string.Format("{0}{1}", languageData.GetContent("Report_Title_Reference"), labStudyModel.LABStudy.idLABStudy) };
                pdfGen.AddTableTitle(rowContents, 110, y += 80);
            }
            #endregion

            #region Page 2 : Client : I. identité du client
            //#Page 2 : Client : I. identité du client
            pdfGen.CreatePage();

            y = 0;
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(languageData.GetContent("Page2_Title"), y, width, 20);

            height = 15;
            y += 5;

            pdfGen.LAB_PlotBooleanValue(labStudyModel.Customer.IsCorporation, y + height, 0, Boolean.FalseString);
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section1_Line1"), 15, y += height, width, 15);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.Customer.IsCorporation, y + height, 0, Boolean.TrueString);
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section1_Line2"), 15, y += height, width, 15);

            y += 5;
            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page2_Section2_Title"), 0, y += height, width, 20);

            //Identité
            y += 5;
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line1"), labStudyModel.GetOptionAttributeValue(718, 516)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line2"), labStudyModel.GetOptionAttributeValue(718, 517)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line3"), labStudyModel.GetOptionAttributeValue(718, 518)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line4"), labStudyModel.GetOptionAttributeValue(718, 519)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line5"), labStudyModel.GetOptionAttributeValue(718, 520)), 0, y += height, width, height);
            var dateImatr = labStudyModel.GetOptionAttributeValue(718, 521);
            dateImatr = (!string.IsNullOrEmpty(dateImatr)) ? dateImatr.Substring(0, 10) : dateImatr;
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line6"), dateImatr), 0, y += height, width, height);

            //Adresse
            pdfGen.AddLabelArial(string.Format("{0} : ", languageData.GetContent("Page2_Section2_Line22")), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0}", labStudyModel.GetOptionAttributeValue(718, 525)), 10, y += height, width, 3 * height);
            //ZipCode
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("PDF_LAB_PM_Page2_ZipCode"), labStudyModel.GetOptionAttributeValue(718, 741)), 0, y += 3 * height, width, height);
            //City
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("PDF_LAB_PM_Page2_Country"), labStudyModel.GetOptionAttributeValue(718, 742)), 0, y += height, width, height);
            //Tel
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line23"), labStudyModel.GetOptionAttributeValue(718, 526)), 0, y += height, width, height);
            //Fax
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("PDF_LAB_PM_Fax"), labStudyModel.GetOptionAttributeValue(718, 751)), 0, y += height, width, height);
            //Mail
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line24"), labStudyModel.GetOptionAttributeValue(718, 527)), 0, y += height, width, height);

            //Domiciliation
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(736), y += 20, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line16_Item1"), 15, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(737), y, 150, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line16_Item2"), 165, y, width, height);

            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line17"), labStudyModel.GetOptionAttributeValue(738, 524)), 0, y += height, width, height);
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line18"), 0, y += height, width, height);
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line19"), 0, y += height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(740), y += height, 25, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_Yes_Caps"), 40, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(741), y, 75, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_No_Caps"), 90, y, width, height);

            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line20"), 0, y += 20, width, height);
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line21"), 0, y += height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(743), y += height, 25, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_Yes_Caps"), 40, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(744), y, 75, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_No_Caps"), 90, y, width, height);

            //Forme juridique
            pdfGen.AddLabelArial(String.Format(@"{0} :", languageData.GetContent("Page2_Section2_Line7")), 0, y += 30, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(721), y += height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line8"), 15, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(722), y += height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line9"), 15, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(723), y += height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line10"), 15, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(724), y += height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line11"), 15, y, width, height);

            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(725), y += height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line12"), 15, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(726), y, 300, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_IS"), 315, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(727), y, 340, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_IR"), 355, y, width, height);

            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(728), y += height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line13"), 15, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(729), y, 300, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_IS"), 315, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(730), y, 340, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_IR"), 355, y, width, height);

            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(731), y += height, 0, "1");
            pdfGen.AddLabelArial(string.Format("{0} {1}", languageData.GetContent("Page2_Section2_Line14"), labStudyModel.GetOptionAttributeValue(731, 522)), 15, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(732), y, 300, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_IS"), 315, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(733), y, 340, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_IR"), 355, y, width, height);

            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(734), y += height, 0, "1");
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line15"), labStudyModel.GetOptionAttributeValue(734, 523)), 15, y, width, height);

            //Societe cotée
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line25"), 0, y += 30, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(748), y += height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_Yes_Caps"), 15, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(749), y, 50, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_No_Caps"), 65, y, width, height);

            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line26"), labStudyModel.GetOptionAttributeValue(746, 528)), 0, y += 20, width, height);
            //pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line27"), labStudyModel.GetOptionAttributeValue(746, 529)), 0, y += height, width, height);
            //pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line28"), labStudyModel.GetOptionAttributeValue(746, 530)), 0, y += height, width, height);
            //pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line29"), labStudyModel.GetOptionAttributeValue(746, 531)), 0, y += height, width, height);
            #endregion

            #region Page 3 : Secteur d'activités
            pdfGen.CreatePage();

            y = 0;
            //Secteur d'activités
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line30"), labStudyModel.GetOptionAttributeValue(751, 532)), 0, y += 30, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line31"), labStudyModel.GetOptionAttributeValue(751, 533)), 0, y += 15, width, height);
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line32"), 0, y += height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(753), y += height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_Yes_Caps"), 15, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(754), y, 50, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_No_Caps"), 65, y, width, height);

            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line33"), labStudyModel.GetOptionAttributeValue(755, 534)), 0, y += 20, width, height * 2);

            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line34"), 0, y += 2 * height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(757), y += height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_Yes_Caps"), 15, y, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(758), y, 50, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_No_Caps"), 65, y, width, height);
            #endregion

            #region Page 4 : Client : II. Personne Morale
            //#Page 3 : Client : II. Personne Morale
            pdfGen.CreatePage();

            y = 0;
            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page3_Section1_Title"), 0, y += 2 * height, width, height);

            string[] tableRiskVigilanceYesNo_Text = { languageData.GetContent("TableRiskVigilanceYesNo_Item1"), languageData.GetContent("TableRiskVigilanceYesNo_Item2"), languageData.GetContent("Report_Symbol_Yes"), languageData.GetContent("Report_Symbol_No") };
            string[] tableRiskVigilanceYesNoIDK_Text = { languageData.GetContent("TableRiskVigilanceYesNo_Item1"), languageData.GetContent("TableRiskVigilanceYesNo_Item2"), languageData.GetContent("Report_Symbol_Yes"), languageData.GetContent("Report_Symbol_No"), languageData.GetContent("TableRiskVigilanceYesNo_Item3") };

            LABAnswer labAnswer = labStudyModel.GetAnswerByIdQuestion(9);
            string[] answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line8"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(10);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line9"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(2);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line1"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(3);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line2"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(4);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line3"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(5);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line4"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(6);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line5"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(7);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line6"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(16);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line7"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            #endregion

            #region Page 5 : Client : III. Facteurs de risque aggravé
            //#Page 4 : Client : III. Facteurs de risque aggravé
            pdfGen.CreatePage();

            y = 0;
            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page4_Section1_Title"), 0, y += 2 * height, width, height);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(17);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line1"), 0, y += 2 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(18);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line2"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(19);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line3"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(20);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line4"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(21);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line5"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(24);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line8"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNoIdk(answer, 0, y += 20, tableRiskVigilanceYesNoIDK_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(22);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line6"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(23);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line7"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(51);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line9"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);
            #endregion

            #region Page 6 : Client : IV. Risques fiscaux
            //#Page 5 : Client : IV. Risques fiscaux
            pdfGen.CreatePage();

            y = 0;
            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page5_Section1_Title"), 0, y += 2 * height, width, height);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(25);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line1"), 0, y += 2 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNoIdk(answer, 0, y += 20, tableRiskVigilanceYesNoIDK_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(26);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line2"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(27);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line3"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(28);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line4"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(29);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line5"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(30);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line6"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(32); 
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line8"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);
            #endregion

            #region Page 7 : Produit : V. L'environnement et les caractéristiques du produit
            //#Page 6 : Produit : V. L'environnement et les caractéristiques du produit
            pdfGen.CreatePage();

            labStudyModel = dicoLABStudyModel[LABStudy.SectionEnum.Product];
            if (emptyLAB)
            {
                labStudyModel = new LABStudyModel();
            }

            y = 0;
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(languageData.GetContent("Page6_Section1_Title"), y, width, 20);

            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page6_Section1_Title2"), 0, y += 2 * height, width, height);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(34);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line1"), 0, y += 2 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(35);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line2"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(36);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line3"), 0, y += 3 * height, width, 3 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 40, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(38);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line5"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(39);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line6"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(40);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line7"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(41);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line8"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(42);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line9"), 0, y += 3 * height, width, 3 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 40, tableRiskVigilanceYesNo_Text);
            #endregion

            #region Page 8 : Produit : V. L'environnement et les caractéristiques du produit
            //#Page 7 : Produit : V. L'environnement et les caractéristiques du produit
            pdfGen.CreatePage();

            y = 0;
            labAnswer = labStudyModel.GetAnswerByIdQuestion(43);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page7_Section1_Line1"), 0, y, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(44);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page7_Section1_Line2"), 0, y += 3 * height, width, 3 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 40, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(45);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page7_Section1_Line3"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(46);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page7_Section1_Line4"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);
            #endregion

            #region Page 9 : Operation : VI. Risques généraux - Risques fiscaux
            //#Page 8 : Operation : VI. Risques généraux / fiscaux
            pdfGen.CreatePage();

            labStudyModel = dicoLABStudyModel[LABStudy.SectionEnum.Operation];
            if (emptyLAB)
            {
                labStudyModel = new LABStudyModel();
                firmInstitution = new FirmInstitution();
                labStudyModel.LABStudy = new LABStudy();
                labStudyModel.Customer = new Upsilab.Data.Model.CustomerProspect();
            }

            y = 0;
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(languageData.GetContent("Page8_Section1_Title"), y, width, 20);

            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page8_Section1_Title2"), 0, y += 2 * height, width, height);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(49);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page8_Section1_Line2"), 0, y += 2 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(50);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page8_Section1_Line3"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            //VII. Risques liés à la distribution des fonds gérés par les sociétés de gestion
            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page9_Section1_Title"), 0, y += 5 * height, width, height);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(57);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section1_Line3"), 0, y += 2 * height, width, 3 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 40, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(58);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section1_Line4"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);
            #endregion

            #region Page 10 : NIVEAU DE RISQUE GLOBAL DU CLIENT
            //#Page 9 : NIVEAU DE RISQUE GLOBAL DU CLIENT            
            pdfGen.CreatePage();

            y = 0;           
            //NIVEAU DE RISQUE GLOBAL DU CLIENT            
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(languageData.GetContent("Page9_Section2_Title"), y, width, 20);

            string dateUpdated = (labStudyModel.LABStudy.DateUpdated.HasValue) ? labStudyModel.LABStudy.DateUpdated.Value.ToString("dd/MM/yyyy") : labStudyModel.LABStudy.DateCreated.ToString("dd/MM/yyyy");
            string idGlobalRisk = labStudyModel.LABStudy.idRisk.ToString();
            string idGlobalVigilance = labStudyModel.LABStudy.idVigilance.ToString();

            pdfGen.AddLabelArial(string.Format("{0} {1}", languageData.GetContent("Page9_Section2_Line1"), dateUpdated), 0, y += 2 * height, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalRisk, y, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section2_Line2"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalRisk, y, 0, "2");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section2_Line3"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalRisk, y, 0, "3");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section2_Line4"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalRisk, y, 0, "4");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section2_Line5"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalRisk, y, 0, "5");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section2_Line6"), 20, y, width, height);

            //NIVEAU DE VIGILANCE GLOBAL DU CLIENT
            y += 60;
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(languageData.GetContent("Page9_Section3_Title"), y, width, 20);

            pdfGen.AddLabelArial(string.Format("{0} {1}", languageData.GetContent("Page9_Section3_Line1"), dateUpdated), 0, y += 2 * height, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalVigilance, y, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section3_Line2"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalVigilance, y, 0, "2");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section3_Line3"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalVigilance, y, 0, "3");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section3_Line4"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalVigilance, y, 0, "4");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section3_Line5"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalVigilance, y, 0, "5");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section3_Line6"), 20, y, width, height);
            #endregion

            //Force download if pathFileName is not set
            if (string.IsNullOrEmpty(pathFileName))
            {
                pdfGen.GeneratePdfToWeb("LAB_PM.pdf");
            }
            else
            {
                pdfGen.GeneratePdf(pathFileName);
            }
        }
        public static byte[] GenerateVigilanceMeasure(Data.Model.VigilanceMeasure vigilanceMeasure)
        {

            //#Page 1 : Title
            int y = 250;
            int height = 20;
            int width = 500;

            FoxitPDFGenerator pdfGen = new FoxitPDFGenerator();

            //Get LAB
            LABStudy labStudy = LABStudyBL.GetLABStudyByIdLABStudy(vigilanceMeasure.idLABStudy);
            FirmInstitution firmInstitution = labStudy.CustomerProspect.FirmInstitution;

            var languageData = PageLanguageHelper.GetLanguageContent("User", "VigilanceMeasurePDF");

            #region Page 1 : Logo & Title
            //Logo
            string logoPathFileName = Upsilab.Business.Utility.FileManager.BuildLogoPath(firmInstitution.idFirmInstitution) + firmInstitution.Logo;
            pdfGen.AddLogoOnFirstPage(logoPathFileName);

            //Title
            pdfGen.AddReceuil_Title_Center_CalibriBold_Label(languageData.GetContent("pdf_mesure_vigilance_title"), y, width, 100);

            string[] rowContents = { string.Format("{0} {1}", languageData.GetContent("pdf_mesure_vigilance_on"), DateTime.Now.ToShortDateString())
                                     , string.Format("{0} MV_{1}", languageData.GetContent("pdf_mesure_vigilance_ref"), vigilanceMeasure.idVigilanceMeasure)
                                     , string.Format("{0} : {1}", languageData.GetContent("pdf_mesure_vigilance_client"), (labStudy.CustomerProspect.IsCorporation.Value) ?  labStudy.CustomerProspect.CompanyName : labStudy.CustomerProspect.Name + " " + labStudy.CustomerProspect.FirstName)
                                     , string.Format("{0} : {1}", languageData.GetContent("pdf_mesure_vigilance_date_lab"), labStudy.DateUpdated.Value.ToString("dd/MM/yyyy"))
                                     , string.Format("{0} LAB_{1}", languageData.GetContent("pdf_mesure_vigilance_ref_lab"), labStudy.idLABStudy)
                                    };

            pdfGen.AddTableTitle(rowContents, 110, y += 80);


            #endregion

            #region Page 2 : Measure content
            //#Page 2 : Client : I. identité du client
            pdfGen.CreatePage();

            y = 0;

            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("pdf_mesure_vigilance_title2"), vigilanceMeasure.Title), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("pdf_mesure_vigilance_date"), vigilanceMeasure.DateMeasure.ToString("dd/MM/yyyy")), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : ", languageData.GetContent("pdf_mesure_vigilance_content")), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0}", vigilanceMeasure.Content), 0, y += height, width, height * 10);
            #endregion

            return pdfGen.GeneratePdf();
        }
        public static void GeneratePP_LAB(IDictionary<LABStudy.SectionEnum, LABStudyModel> dicoLABStudyModel, string pathFileName, bool emptyLAB = false)
        {

            //#Page 1 : Title
            int y = 160;
            int height = 20;
            int width = 500;

            FoxitPDFGenerator pdfGen = new FoxitPDFGenerator();
            CustomEnum = Upsilab.Business.Custom.CustomEnumBL.GetAllCustomEnums();
            EnumLanguages = GetLanguageEnum(1);

            LABStudyModel labStudyModel = dicoLABStudyModel[LABStudy.SectionEnum.Client];
            FirmInstitution firmInstitution = labStudyModel.Customer.FirmInstitution;

            if (emptyLAB)
            {
                labStudyModel = new LABStudyModel();
                firmInstitution = new FirmInstitution();
                labStudyModel.LABStudy = new LABStudy();
                labStudyModel.Customer = new Upsilab.Data.Model.CustomerProspect();
            }

            var languageData = PageLanguageHelper.GetLanguageContent("User", "LAB_PDF_PP_Report");


            #region Page 1 : Logo & Title
            //Logo
            string logoPathFileName = Upsilab.Business.Utility.FileManager.BuildLogoPath(firmInstitution.idFirmInstitution) + firmInstitution.Logo;
            pdfGen.AddLogoOnFirstPage(logoPathFileName);

            //Title
            pdfGen.AddReceuil_Title_Center_CalibriBold_Label(languageData.GetContent("Report_Title"), y, width, 100);
            pdfGen.AddReceuil_SubTitle_Center_CalibriBold_Label(languageData.GetContent("Report_Title2"), y += 100, width, height);

            if (emptyLAB)
            {
                string[] rowContents = { string.Format("{0} {1}", languageData.GetContent("Report_Title_Date"), ""),
                                       string.Format("{0}{1}", languageData.GetContent("Report_Title_Reference"), "") };
                pdfGen.AddTableTitle(rowContents, 110, y += 80);
            }
            else
            {
                string[] rowContents = { string.Format("{0} {1}", languageData.GetContent("Report_Title_Date"), labStudyModel.LABStudy.DateUpdated.HasValue ? labStudyModel.LABStudy.DateUpdated.Value.ToShortDateString() : labStudyModel.LABStudy.DateCreated.ToShortDateString()),
                                       string.Format("{0}{1}", languageData.GetContent("Report_Title_Reference"), labStudyModel.LABStudy.idLABStudy) };
                pdfGen.AddTableTitle(rowContents, 110, y += 80);
            }
            #endregion

            #region Page 2 : Client : I. Identité du client
            //#Page 2 : Client : I. identité du client
            pdfGen.CreatePage();

            y = 0;
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(languageData.GetContent("Page2_Title"), y, width, 20);

            height = 15;
            y += 35;
            pdfGen.LAB_PlotBooleanValue(labStudyModel.Customer.IsCorporation, y + height, 0, Boolean.FalseString);
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section1_Line1"), 15, y += height, width, 15);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.Customer.IsCorporation, y + height, 0, Boolean.TrueString);
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section1_Line2"), 15, y += height, width, 15);

            y += height;
            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page2_Section2_Title"), 0, y += height, width, 20);

            // civilité
            y += 2 * height;
            float tabCheck = 15;
            float x = 0;
            pdfGen.AddLabelArial(languageData.GetContent("LABPP_1227"), 0, y, width, height);

            x = 40;
            pdfGen.LAB_PlotBooleanValue(labStudyModel.Customer.Title, y, x, languageData.GetContent("LABPP_1228"));
            pdfGen.AddLabelArial(languageData.GetContent("LABPP_1228"), x = x + tabCheck, y, width, 15);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.Customer.Title, y, x = x + tabCheck + 40, languageData.GetContent("LABPP_1229"));
            pdfGen.AddLabelArial(languageData.GetContent("LABPP_1229"), x = x + tabCheck, y, width, 15);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.Customer.Title, y, x = x + tabCheck + 40, languageData.GetContent("LABPP_1230"));
            pdfGen.AddLabelArial(languageData.GetContent("LABPP_1230"), x = x + tabCheck, y, width, 15);


            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line1"), labStudyModel.GetOptionAttributeValue(701, 501)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line2"), labStudyModel.GetOptionAttributeValue(701, 502)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line3"), labStudyModel.GetOptionAttributeValue(701, 503)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line4"), labStudyModel.GetOptionAttributeValue(701, 504)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line5"), labStudyModel.GetOptionAttributeValue(701, 505)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line6"), labStudyModel.GetOptionAttributeValue(701, 506)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line7"), labStudyModel.GetOptionAttributeValue(701, 507)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line8"), labStudyModel.GetOptionAttributeValue(701, 508)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line9"), labStudyModel.GetOptionAttributeValue(701, 509)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line10"), labStudyModel.GetOptionAttributeValue(701, 510)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line11"), labStudyModel.GetOptionAttributeValue(701, 511)), 0, y += height, width, 3 * height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line12"), labStudyModel.GetOptionAttributeValue(701, 512)), 0, y += 3 * height, width, 3 * height);

            y += 2 * height;
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line13"), 0, y += height, width, height);

            //Etes-vous
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(703), y + height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line14_Item1"), 15, y + height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(704), y + height, 200, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line14_Item2"), 215, y += height, width, height);

            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(705), y + height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line15_Item1"), 15, y + height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(706), y + height, 200, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line15_Item2"), 215, y += height, width, height);

            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(1127), y + height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line16_Item1"), 15, y + height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(1150), y + height, 200, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line16_Item2"), 215, y += height, width, height);

            //Représentant légal
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_LegalRepresentative"), labStudyModel.GetOptionAttributeValue(702, 740)), 0, y += height, width, height);

            y += height;
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line17"), labStudyModel.GetOptionAttributeValue(702, 513)), 0, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line18"), labStudyModel.GetOptionAttributeValue(702, 514)), 0, y += height, width, height);

            y += height;
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(708), y + height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line19_Item1"), 15, y + height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(709), y + height, 100, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line19_Item2"), 115, y += height, width, height);
            pdfGen.AddLabelArial(string.Format("{0} : {1}", languageData.GetContent("Page2_Section2_Line20"), GetEnumValue(labStudyModel.GetOptionAttributeValue(710, 515), 12)), 0, y += height, width, height);

            y += height;
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line21"), 0, y += height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(712), y + height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_Yes"), 15, y + height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(713), y + height, 50, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_No"), 65, y += height, width, height);

            y += height;
            pdfGen.AddLabelArial(languageData.GetContent("Page2_Section2_Line22"), 0, y += height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(715), y + height, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_Yes"), 15, y + height, width, height);
            pdfGen.LAB_PlotBooleanValue(labStudyModel.GetOptionValue(716), y + height, 50, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Report_Symbol_No"), 65, y += height, width, height);
            #endregion

            #region Page 3 : Client : II. Personne physique
            //#Page 3 : Client : II. Personne physique
            pdfGen.CreatePage();

            y = 0;
            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page3_Section1_Title"), 0, y += 2 * height, width, height);

            //CLIENT MENU

            LABAnswer labAnswer = labStudyModel.GetAnswerByIdQuestion(11);
            string[] tableRiskVigilanceYesNo_Text = { languageData.GetContent("TableRiskVigilanceYesNo_Item1"), languageData.GetContent("TableRiskVigilanceYesNo_Item2"), languageData.GetContent("Report_Symbol_Yes"), languageData.GetContent("Report_Symbol_No") };
            string[] tableRiskVigilanceYesNoIDK_Text = { languageData.GetContent("TableRiskVigilanceYesNo_Item1"), languageData.GetContent("TableRiskVigilanceYesNo_Item2"), languageData.GetContent("Report_Symbol_Yes"), languageData.GetContent("Report_Symbol_No"), languageData.GetContent("TableRiskVigilanceYesNo_Item3") };
            string[] answer = { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line1"), 0, y += 2 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            //This question is for only client (not prospect)
            if (labStudyModel.Customer.IsCustomer)
            {
                labAnswer = labStudyModel.GetAnswerByIdQuestion(12);
                answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
                pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line2"), 0, y += 3 * height, width, 2 * height);
                pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);
            }

            labAnswer = labStudyModel.GetAnswerByIdQuestion(13);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line3"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            //labAnswer = labStudyModel.GetAnswerByIdQuestion(14);
            //answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            //pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line4"), 0, y += 3 * height, width, height);
            //pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            //labAnswer = labStudyModel.GetAnswerByIdQuestion(15);
            //answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            //pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line5"), 0, y += 3 * height, width, height);
            //pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(67);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line5_1"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(68);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line5_2"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            //labAnswer = labStudyModel.GetAnswerByIdQuestion(16);
            //answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            //pdfGen.AddLabelArial(languageData.GetContent("Page3_Section1_Line6"), 0, y += 3 * height, width, height);
            //pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);
            #endregion

            #region Page 4 : Client : III. Facteurs de risque aggravé
            //#Page 4 : Client : III. Facteurs de risque aggravé
            pdfGen.CreatePage();

            y = 0;
            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page4_Section1_Title"), 0, y += 2 * height, width, height);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(17);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line1"), 0, y += 2 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(18);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line2"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(19);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line3"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(20);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line4"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(21);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line5"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(24);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line6"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNoIdk(answer, 0, y += 20, tableRiskVigilanceYesNoIDK_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(22);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line7"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(23);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page4_Section1_Line8"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(51);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page8_Section1_Line6"), 0, y += 3 * height, width, height); //Question from operation
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);
            #endregion

            #region Page 5 : Client : IV. Risques fiscaux
            //#Page 5 : Client : IV. Risques fiscaux
            pdfGen.CreatePage();

            y = 0;
            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page5_Section1_Title"), 0, y += 2 * height, width, height);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(25);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line1"), 0, y += 2 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNoIdk(answer, 0, y += 20, tableRiskVigilanceYesNoIDK_Text);

            //The following three questions are for PM
            /*labAnswer = labStudyModel.GetAnswerByIdQuestion(26);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial("La société cliente a-t-elle connu des changements statutaires fréquents non justifiés par la situation économique de l’entreprise ?", 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(27);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial("La société cliente en sommeil ou peu active a-t-elle connu des changements statutaires récents ?", 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(28);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial("La société cliente a-t-elle recours à l’interposition de personnes physiques n’intervenant qu’en apparence pour le compte de clients de la PSI ou du CIF ?", 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30);*/

            labAnswer = labStudyModel.GetAnswerByIdQuestion(29);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line2"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(30);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line3"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(31);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line4"), 0, y += 3 * height, width, 3 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 40, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(32);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page5_Section1_Line5"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);
            #endregion

            #region Page 6 : Produit : V. L'environnement et les caractéristiques du produit
            //#Page 6 : Produit : V. L'environnement et les caractéristiques du produit
            pdfGen.CreatePage();

            labStudyModel = dicoLABStudyModel[LABStudy.SectionEnum.Product];

            if (emptyLAB)
            {
                labStudyModel = new LABStudyModel();
            }

            y = 0;
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(languageData.GetContent("Page6_Section1_Title"), y, width, 20);

            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page6_Section1_Title2"), 0, y += 2 * height, width, height);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(34);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line1"), 0, y += 2 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(35);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line2"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(36);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line3"), 0, y += 3 * height, width, 3 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 40, tableRiskVigilanceYesNo_Text);

            //labAnswer = labStudyModel.GetAnswerByIdQuestion(37);
            //answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            //pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line4"), 0, y += 3 * height, width, height);
            //pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(38);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line5"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(39);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line6"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(40);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line7"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(41);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line8"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(42);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page6_Section1_Line9"), 0, y += 3 * height, width, 3 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 40, tableRiskVigilanceYesNo_Text);
            #endregion

            #region Page 7 : Produit : V. L'environnement et les caractéristiques du produit
            //#Page 7 : Produit : V. L'environnement et les caractéristiques du produit
            pdfGen.CreatePage();

            y = 0;
            labAnswer = labStudyModel.GetAnswerByIdQuestion(43);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page7_Section1_Line1"), 0, y, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(44);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page7_Section1_Line2"), 0, y += 3 * height, width, 3 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 40, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(45);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page7_Section1_Line3"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(46);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page7_Section1_Line4"), 0, y += 3 * height, width, 3 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 40, tableRiskVigilanceYesNo_Text);
            #endregion

            #region Page 8 : Operation : VI. Risques généraux / fiscaux
            //#Page 8 : Operation : VI. Risques généraux
            pdfGen.CreatePage();

            labStudyModel = dicoLABStudyModel[LABStudy.SectionEnum.Operation];
            if (emptyLAB)
            {
                labStudyModel = new LABStudyModel();
                firmInstitution = new FirmInstitution();
                labStudyModel.LABStudy = new LABStudy();
                labStudyModel.Customer = new Upsilab.Data.Model.CustomerProspect();
            }

            y = 0;
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(languageData.GetContent("Page8_Section1_Title"), y, width, 20);

            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page8_Section1_Title2"), 0, y += 2 * height, width, height);

            //labAnswer = labStudyModel.GetAnswerByIdQuestion(48);
            //answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            //pdfGen.AddLabelArial(languageData.GetContent("Page8_Section1_Line1"), 0, y += 2 * height, width, 2 * height);
            //pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(49);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page8_Section1_Line2"), 0, y += 3 * height, width, height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            labAnswer = labStudyModel.GetAnswerByIdQuestion(50);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page8_Section1_Line3"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            //labAnswer = labStudyModel.GetAnswerByIdQuestion(52);
            //answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            //pdfGen.AddLabelArial(languageData.GetContent("Page8_Section1_Line4"), 0, y += 3 * height, width, 2 * height);
            //pdfGen.AddLabelArial(languageData.GetContent("Page8_Section1_Line5"), 0, y += 2 * height, width, 10 * height);
            //pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 8 * height, tableRiskVigilanceYesNo_Text);

            //VII. Risques liés à la distribution des fonds gérés par les sociétés de gestion
            //pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page8_Section2_Title"), 0, y += 4 * height, width, height);

            //labAnswer = labStudyModel.GetAnswerByIdQuestion(53);
            //answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            //pdfGen.AddLabelArial(languageData.GetContent("Page8_Section2_Line1"), 0, y += 2 * height, width, height);
            //pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            //labAnswer = labStudyModel.GetAnswerByIdQuestion(54);
            //answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            //pdfGen.AddLabelArial(languageData.GetContent("Page8_Section2_Line2"), 0, y += 3 * height, width, height);
            //pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 20, tableRiskVigilanceYesNo_Text);

            //VIII. Risques fiscaux
            pdfGen.LAB_AddChapterTitle_Calibri(languageData.GetContent("Page9_Section1_Title"), 0, y += 4 * height, width, height);

            //labAnswer = labStudyModel.GetAnswerByIdQuestion(55);
            //answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            //pdfGen.AddLabelArial(languageData.GetContent("Page9_Section1_Line1"), 0, y += 2 * height, width, height);
            //pdfGen.LAB_AddTableRiskVigilance_YesNoIdk(answer, 0, y += 20, tableRiskVigilanceYesNoIDK_Text);

            //labAnswer = labStudyModel.GetAnswerByIdQuestion(56);
            //answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            //pdfGen.AddLabelArial(languageData.GetContent("Page9_Section1_Line2"), 0, y += 3 * height, width, 2 * height);
            //pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNo_Text);

            //This question is only for client (not prospect)
            if (labStudyModel.Customer.IsCustomer)
            {
                labAnswer = labStudyModel.GetAnswerByIdQuestion(57);
                answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
                pdfGen.AddLabelArial(languageData.GetContent("Page9_Section1_Line3"), 0, y += 3 * height, width, 3 * height);
                pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 40, tableRiskVigilanceYesNo_Text);
            }

            labAnswer = labStudyModel.GetAnswerByIdQuestion(58);
            answer = new string[] { labAnswer.idResponse.ToString(), labAnswer.RiskLabel, labAnswer.VigilanceLabel };
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section1_Line4"), 0, y += 3 * height, width, 2 * height);
            pdfGen.LAB_AddTableRiskVigilance_YesNo(answer, 0, y += 30, tableRiskVigilanceYesNoIDK_Text);
            #endregion

            #region Page 9 : NIVEAU DE RISQUE GLOBAL DU CLIENT
            //#Page 9 : NIVEAU DE RISQUE GLOBAL DU CLIENT
            pdfGen.CreatePage();

            y = 0;            
            //NIVEAU DE RISQUE GLOBAL DU CLIENT           
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(languageData.GetContent("Page9_Section2_Title"), y, width, 20);


            string dateUpdated = (labStudyModel.LABStudy.DateUpdated.HasValue) ? labStudyModel.LABStudy.DateUpdated.Value.ToString("dd/MM/yyyy") : labStudyModel.LABStudy.DateCreated.ToString("dd/MM/yyyy");
            string idGlobalRisk = labStudyModel.LABStudy.idRisk.ToString();
            string idGlobalVigilance = labStudyModel.LABStudy.idVigilance.ToString();

            pdfGen.AddLabelArial(string.Format("{0} {1}", languageData.GetContent("Page9_Section2_Line1"), dateUpdated), 0, y += 2 * height, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalRisk, y, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section2_Line2"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalRisk, y, 0, "2");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section2_Line3"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalRisk, y, 0, "3");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section2_Line4"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalRisk, y, 0, "4");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section2_Line5"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalRisk, y, 0, "5");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section2_Line6"), 20, y, width, height);

            //NIVEAU DE VIGILANCE GLOBAL DU CLIENT
            y += 60;
            pdfGen.AddReceuil_ChapterTitle_Center_CalibriBoldItalic_Label(languageData.GetContent("Page9_Section3_Title"), y, width, 20);

            pdfGen.AddLabelArial(string.Format("{0} {1}", languageData.GetContent("Page9_Section3_Line1"), dateUpdated), 0, y += 2 * height, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalVigilance, y, 0, "1");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section3_Line2"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalVigilance, y, 0, "2");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section3_Line3"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalVigilance, y, 0, "3");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section3_Line4"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalVigilance, y, 0, "4");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section3_Line5"), 20, y, width, height);

            y += 20;
            pdfGen.LAB_PlotBooleanValue(idGlobalVigilance, y, 0, "5");
            pdfGen.AddLabelArial(languageData.GetContent("Page9_Section3_Line6"), 20, y, width, height);
            #endregion

            //Force download if pathFileName is not set
            if (string.IsNullOrEmpty(pathFileName))
            {
                pdfGen.GeneratePdfToWeb("LAB_PP.pdf");
            }
            else
            {
                pdfGen.GeneratePdf(pathFileName);
            }

        }
        public static void GenerateInvoiceForSubscription(Subscription subscription, FirmInstitution firm, string pDirectory, string pLogoPath, out string pFactName, DateTime? dateUpdated = null)
        {
            FoxitPDFGenerator pdfGen = new FoxitPDFGenerator();
            pdfGen.AddImage(pLogoPath, 0, 10);
            string sdateUpdated = dateUpdated.HasValue ? dateUpdated.Value.ToShortDateString() : subscription.IsPaid ? DateTime.Now.ToShortDateString() : string.Empty;

            if (!string.IsNullOrEmpty(sdateUpdated))
                pdfGen.AddLabelArial(string.Format(LanguageContentBL.Translate("PdfBill_001"), sdateUpdated), 400, 30, 150, 12);
            //pdfGen.AddLabelArialBold("UPSIDEO\n", 400, 30, 150, 12);
            //pdfGen.AddLabelArial("89 Boulevard Malesherbes\n75008 PARIS\nFRANCE\[email protected]", 400, 40, 150, 100);

            Dictionary<int, string[]> dataFacturation = new Dictionary<int, string[]>();
            string[] columnsFacturation = { LanguageContentBL.Translate("PdfBill_002") };
            StringBuilder sbAdresse = new StringBuilder();
            sbAdresse.Append(string.Format("\n{0}\n", firm.FirmInstitutionName));
            sbAdresse.Append(string.Format("{0}\n", firm.FirmStreet));
            sbAdresse.Append(string.Format("{0} {1}\n", firm.FirmPostCode, firm.FirmCity));

            int i = 0;
            string[] adresseLine = { sbAdresse.ToString() };
            dataFacturation.Add(i++, adresseLine);

            pdfGen.AddTable1(columnsFacturation, dataFacturation, 0, 200, 500, 300, 11, false);

            // Generation du tableau de la facture
            // Entete 1
            string[] ColumnsEntete = { string.Format(LanguageContentBL.Translate("PdfBill_003"), subscription.DateCreated.ToString("ddMMyyyy"), subscription.IdSubscription), string.Format(LanguageContentBL.Translate("PdfBill_004"), DateTime.Now.ToShortDateString()) };
            pdfGen.AddEnteteTable(ColumnsEntete, 0, 325, 510, 20, 11);

            //Entete 2
            i = 0;
            string[] columns = { LanguageContentBL.Translate("PdfBill_005"), LanguageContentBL.Translate("PdfBill_006"), LanguageContentBL.Translate("PdfBill_007"), LanguageContentBL.Translate("PdfBill_008") };

            Dictionary<int, string[]> data = new Dictionary<int, string[]>();

            //TODO
            string licenseInvoiceLineLabel = string.Empty;

            //Display license : autre que renouvellement renouvellement
            if (subscription.UserCount > 0)
            {
                string applicationName = (!string.IsNullOrEmpty(subscription.Application)) ? subscription.Application : string.Empty;
                licenseInvoiceLineLabel = string.Format(LanguageContentBL.Translate("PdfBill_009"), subscription.UserCount, applicationName, subscription.Duration.Value, subscription.Duration.Value == 1 ? LanguageContentBL.Translate("PdfBill_011_1") : LanguageContentBL.Translate("PdfBill_011_2"));

                string[] applicationLine = { licenseInvoiceLineLabel
                                             , subscription.UserCount.ToString()
                                             , string.Format(LanguageContentBL.Translate("PdfBill_010"), (subscription.ApplicationCost / (decimal)subscription.UserCount))
                                             , string.Format(LanguageContentBL.Translate("PdfBill_010"),subscription.ApplicationCost)};

                data.Add(i++, applicationLine);
            }

            //Display license : Cas renouvellement
            if (subscription.Product.Contains(SouscriptionBL.Product_Type_renouvellement))
            {
                IList<Data.Model.License> licencesToRenew = SouscriptionBL.GetLicensesToRenewByIdSubscription(subscription.IdSubscription);
                subscription.LicensesToRenew = licencesToRenew.ToList();

                //Cas superadmin
                if (subscription.LicensesToRenewGroupedByApplicationType == null)
                {
                    subscription = SouscriptionBL.GroupLicencesToRenewByApplicationType(subscription);
                }

                foreach (var lic in subscription.LicensesToRenewGroupedByApplicationType)
                {
                    int licensesCount = lic.Licences.Count;

                    if (licensesCount > 0)
                    {
                        //licenseInvoiceLineLabel = string.Format("{0} licence(s) {1}", lic.Licences.Count, lic.ApplicationType);
                        licenseInvoiceLineLabel = string.Format(LanguageContentBL.Translate("PdfBill_009"), lic.Licences.Count, lic.ApplicationType, subscription.Duration.Value, subscription.Duration.Value == 1 ? LanguageContentBL.Translate("PdfBill_011_1") : LanguageContentBL.Translate("PdfBill_011_2"));

                        decimal? applicationCost = 0;
                        if (lic.ApplicationType == SouscriptionBL.ReportLabApplication.ToString())
                        {
                            applicationCost = subscription.RenewReportLabCost;
                        }
                        else if (lic.ApplicationType == SouscriptionBL.ReportApplication.ToString())
                        {
                            applicationCost = subscription.RenewReportCost;
                        }
                        else if (lic.ApplicationType == SouscriptionBL.LabApplication.ToString())
                        {
                            applicationCost = subscription.RenewLabCost;
                        }

                        if (applicationCost.HasValue && applicationCost.Value > 0)
                        {
                            //appilcationCost = applicationCost :)
                        }
                        else
                        {
                            applicationCost = lic.AmountHT;
                        }

                        string[] applicationLine = { licenseInvoiceLineLabel
                                                     , licensesCount.ToString()
                                                     , string.Format(LanguageContentBL.Translate("PdfBill_010"), (applicationCost.Value / (decimal)licensesCount))
                                                     , string.Format(LanguageContentBL.Translate("PdfBill_010"), applicationCost.Value)};

                        data.Add(i++, applicationLine);
                    }
                }

            }

            #region Reduction parrainage
            //Display reduction
            //if (!string.IsNullOrEmpty(subscription.SponsorshipCode))
            if (!string.IsNullOrEmpty(subscription.SponsorshipCode) || subscription.Reduction > 0)
            {
                string remiseLabel = (subscription.ReductionPercent > 0) ? string.Format(LanguageContentBL.Translate("PdfBill_011"), subscription.ReductionPercent) : LanguageContentBL.Translate("PdfBill_011_0");
                string[] applicationLine = { remiseLabel
                                                 , ""
                                                 , ""
                                                 , string.Format("- "+LanguageContentBL.Translate("PdfBill_010"), subscription.Reduction)};
                data.Add(i++, applicationLine);
            }
            #endregion

            #region Credit
            //Display credit
            if (subscription.CreditNumber > 0)
            {
                string[] creditLine = { string.Format(LanguageContentBL.Translate("PdfBill_012"), subscription.CreditNumber),
                                                subscription.CreditNumber.ToString(),
                                                string.Empty,
                                                string.Format(LanguageContentBL.Translate("PdfBill_010"),subscription.CreditCost)};
                data.Add(i++, creditLine);
            }
            #endregion

            #region Sponsor
            //Display sponsoring²
            if (subscription.IdSponsor.HasValue)
            {
                Sponsor spons = SponsorBL.GetById(subscription.IdSponsor.Value);
                string[] sponsorLine = { string.Format(LanguageContentBL.Translate("PdfBill_sponsor_1"), spons.Name)
                                           , ""
                                           , ""
                                           , string.Format("- "+LanguageContentBL.Translate("PdfBill_010"), subscription.SponsorAmount)};
                data.Add(i++, sponsorLine);
            }
            #endregion

            string[] EmptyLines = { "", "", "", "" };
            data.Add(i++, EmptyLines);

            pdfGen.AddTable2(columns, data, 0, 345, 510, 300, 9, false);

            i = 0;
            Dictionary<int, string[]> AmountData = new Dictionary<int, string[]>();
            string[] htLine = { LanguageContentBL.Translate("PdfBill_008"), string.Format(LanguageContentBL.Translate("PdfBill_010"), subscription.AmountHT) };
            AmountData.Add(i++, htLine);
         
            if (subscription.AmountHT != subscription.TotalAmount)
            {
                decimal taux = ConfigurationManager.ExtranetHostCode == Upsilab.Business.Language.LanguageContentBL.HostCode.FR.ToString() ? ConfigurationManager.TauxTVA : ConfigurationManager.TauxTVABe;
                string[] TauxTvaLine = { LanguageContentBL.Translate("PdfBill_013"), string.Format("{0}%", taux) };
                AmountData.Add(i++, TauxTvaLine);
                string[] TvaLine = { LanguageContentBL.Translate("PdfBill_014"), string.Format(LanguageContentBL.Translate("PdfBill_010"), (subscription.TotalAmount - subscription.AmountHT)) };
                AmountData.Add(i++, TvaLine);
                string[] TTCLine = { LanguageContentBL.Translate("PdfBill_015"), string.Format(LanguageContentBL.Translate("PdfBill_010"), subscription.TotalAmount) };
                AmountData.Add(i++, TTCLine);
            }

            pdfGen.AddTable3(AmountData, 350, 460, 160, 300, 10, false);

            string[] Columns = { "UPSIDEO\n89 Boulevard Malesherbes 75008 PARIS\nTel : 01.44.69.59.80 / Fax : 01.43.87.20.45 \nN° R.C.S. PARIS 538 768 003 " };
            pdfGen.AddTable(null, Columns, -30, 650, 10, 60, false, true, false, 200);


            pFactName = string.Format("FA_{0}_{1}.pdf", subscription.DateCreated.ToString("ddMMyyyy"), subscription.IdSubscription);

            if (!Directory.Exists(pDirectory))
            {
                Directory.CreateDirectory(pDirectory);
            }

            string pathFileName = System.IO.Path.Combine(pDirectory, pFactName);

            if (File.Exists(pathFileName))
            {
                pFactName = string.Format("FA_{0}_{1}_2.pdf", subscription.DateCreated.ToString("ddMMyyyy"), subscription.IdSubscription);
            }

            pdfGen.GeneratePdf(System.IO.Path.Combine(pDirectory, pFactName));

        }