示例#1
0
        private Model.User MapUser(Data.Model.User user, bool mapClaims = true)
        {
            if (user == null)
            {
                return(new Model.User());
            }

            string[] roles  = user.Roles.Select(o => o.RoleId).Distinct().ToArray();
            string[] claims = null;

            if (mapClaims)
            {
                claims = user.Roles.Select(o => o.Role).SelectMany(o => o.SecurityClaims).Select(o => o.SecurityClaimId).Distinct().ToArray();
            }

            return(new Model.User()
            {
                CreatedOn = user.CreatedOn,
                CultureName = user.CultureName,
                DisplayName = user.DisplayName,
                Enabled = user.Enabled,
                Claims = claims ?? new string[] { },
                Roles = roles,
                TimeZoneId = user.TimeZoneId,
                UserId = user.UserId,
                Username = user.Username
            });
        }
示例#2
0
        public async Task <IActionResult> CreateUser([FromBody] UserDTO userDto)
        {
            try
            {
                if (userDto == null)
                {
                    return(BadRequest());
                }
                var user = new Data.Model.User()
                {
                    UserName = userDto.UserName,
                    Password = _encryptor.Encrypt(userDto.Password),
                    EmailId  = userDto.EmailId
                };
                await Context.Users.AddAsync(user);

                await Context.SaveChangesAsync();

                return(CreatedAtAction("", new { id = user.Id }));
            }
            catch (Exception ex)
            {
                return(Unauthorized());
            }
        }
示例#3
0
        public static Upsilab.Data.Model.User CreateUser(Upsilab.Data.Model.User user, String pasword)
        {
            user.UserPassword = UserBL.Encrypt(pasword);

            using (UpsilabEntities context = new UpsilabEntities())
            {
                var _user = new Data.Model.User();
                _user.idUser = user.idUser;
                _user.idUserProfile = user.idUserProfile;
                _user.UserLogin = user.UserLogin;
                _user.UserPassword = user.UserPassword;
                _user.UserName = user.UserName;
                _user.UserFirstName = user.UserFirstName;
                _user.UserMobilePhone = user.UserMobilePhone;
                _user.UserEmail = user.UserEmail;
                _user.IsActive = user.IsActive;
                _user.IsDeleted = user.IsDeleted;
                _user.DateCreated = DateTime.Now;
                _user.IdLicenseReport = user.IdLicenseReport;
                _user.IdLicenseLab = user.IdLicenseLab;
                //context.User.AddObject(user);
                context.User.AddObject(_user);
                context.SaveChanges();
            }

            return user;
        }
        public int Update(Data.Model.User user)
        {
            db = new BespokeDbEntities();

            db.Entry(user).State = System.Data.Entity.EntityState.Modified;

            return(db.SaveChanges());
        }
 public User CreateUser(Data.Model.User modelUser)
 {
     return(CreateUser(
                modelUser.Username,
                modelUser.Firstname,
                modelUser.Lastname,
                modelUser.Email,
                modelUser.UserId));
 }
        public Data.Model.User GetLogin(string username, string password)
        {
            var user = new Data.Model.User();

            db = new BespokeDbEntities();

            user = db.Users.Where(x => x.Username == username && x.Password == password).FirstOrDefault();

            return(user);
        }
示例#7
0
        public async Task <IUserExtended> UpdateUserCulture(long userId, string cultureName, string timeZoneId)
        {
            Data.Model.User dbUser = this.ResolveUser(userId);

            if (dbUser == null)
            {
                return(null);
            }

            new ManageUserHelper(dbUser).UpdateCulture(cultureName, timeZoneId);

            await this.db.SaveChangesAsync();

            return(this.MapUser(dbUser));
        }
示例#8
0
        public async Task <IUserExtended> UpdateUserStatus(string username, bool enabled)
        {
            Data.Model.User dbUser = this.ResolveUser(username);

            if (dbUser == null)
            {
                return(null);
            }

            new ManageUserHelper(dbUser).UpdateStatus(enabled);

            await this.db.SaveChangesAsync();

            return(this.MapUser(dbUser));
        }
示例#9
0
        async Task <IUserExtended> IManageProfileService.UpdateUserCulture(long userId, string cultureName, string timeZoneId)
        {
            Data.Model.User dbUser = this.db.User.SingleOrDefault(o => o.UserId == userId);

            if (dbUser == null)
            {
                return(null);
            }

            new ManageUserHelper(dbUser).UpdateCulture(cultureName, timeZoneId);

            await this.db.SaveChangesAsync();

            return(this.MapUser(dbUser));
        }
示例#10
0
        public Data.Model.User Authenticate(UserLoginRequest request)
        {
            var user = _context.User.Include("UserType").FirstOrDefault(x => x.Username == request.Username);

            if (user != null)
            {
                var newHash = HashGenerator.GenerateHash(user.PasswordSalt, request.Password);

                if (newHash == user.PasswordHash)
                {
                    Data.Model.User tUser = _mapper.Map <Data.Model.User>(user);
                    return(tUser);
                }
            }
            return(null);
        }
            protected override async Task <string> HandleCore(Command request)
            {
                var identity = await CreateUserIdentity(request);

                var user = new Data.Model.User
                {
                    Id       = Guid.NewGuid().ToString(),
                    Identity = identity,
                    Active   = true
                };

                partyPlannerContext.Users.Add(user);

                await partyPlannerContext.SaveChangesAsync();

                return(user.Id);
            }
        public async Task <IUserExtended> UpdateUser(IUserExtended user)
        {
            Data.Model.User dbUser = this.ResolveUser(user.Username);

            if (dbUser == null)
            {
                return(null);
            }

            new ManageUserHelper(dbUser)
            .UpdateProfile(user);

            this.db.UpdateUserRoles(dbUser, user.Roles.ToArray());

            await this.db.SaveChangesAsync();

            return(this.MapUser(dbUser));
        }
示例#13
0
        public async Task <ClaimsIdentity> UpdateUserCulture(long userId, string cultureName, string timeZoneId)
        {
            Data.Model.User dbUser = this.db.User.SingleOrDefault(o => o.UserId == userId);

            if (dbUser == null)
            {
                return(null);
            }

            new ManageUserHelper(dbUser).UpdateCulture(cultureName, timeZoneId);

            await this.db.SaveChangesAsync();

            string         fingerprint = this.deviceProfiler.DeriveFingerprint(dbUser);
            ClaimsIdentity identity    = dbUser.ToClaimsIdentity(this.config.ClaimsNamespace, fingerprint);

            return(identity);
        }
        protected override async Task <AuthenticateResult> HandleAuthenticateAsync()
        {
            if (!Request.Headers.ContainsKey("Authorization"))
            {
                return(AuthenticateResult.Fail("Missing Authorization Header"));
            }

            Data.Model.User user = null;
            try
            {
                var authHeader      = AuthenticationHeaderValue.Parse(Request.Headers["Authorization"]);
                var credentialBytes = Convert.FromBase64String(authHeader.Parameter);
                var credentials     = Encoding.UTF8.GetString(credentialBytes).Split(':');
                var username        = credentials[0];
                var password        = credentials[1];
                user = _userService.Authenticate(new UserLoginRequest()
                {
                    Username = username,
                    Password = password
                });
            }
            catch
            {
                return(AuthenticateResult.Fail("Invalid Authorization Header"));
            }

            if (user == null)
            {
                return(AuthenticateResult.Fail("Invalid Username or Password"));
            }

            var claims = new List <Claim> {
                new Claim(ClaimTypes.NameIdentifier, user.Username),
                new Claim(ClaimTypes.Name, user.FirstName),
            };

            claims.Add(new Claim(ClaimTypes.Role, user.UserType.Type));

            var identity  = new ClaimsIdentity(claims, Scheme.Name);
            var principal = new ClaimsPrincipal(identity);
            var ticket    = new AuthenticationTicket(principal, Scheme.Name);

            return(AuthenticateResult.Success(ticket));
        }
        public async Task <IActionResult> SignUp([FromBody] SignUpRequest newUser)
        {
            string hashedPass = Infrastructure.Service.EncryptionHelper.CreateHashed(newUser.Password);

            var createdUser = new Data.Model.User
            {
                Email          = newUser.Email,
                HashedPassword = hashedPass,
            };

            var createUserResult = await _userService.CreateUser(createdUser);

            if (createUserResult.IsSuccessful)
            {
                _logger.LogInformation($"{createdUser.Id}-{createdUser.Id} signed in as user!");
            }

            return(Ok(createUserResult));
        }
     private Model.User MapUser(Data.Model.User user)
     {
         if (user == null)
         {
             return(new Model.User());
         }
         else
         {
             return new Model.User()
                    {
                        DisplayName = user.DisplayName,
                        Enabled     = user.Enabled,
                        Roles       = user.Roles.Select(o => o.RoleId),
                        UserId      = user.UserId,
                        Username    = user.Username,
                        Verified    = user.Verified
                    }
         };
     }
 }
示例#17
0
     private Model.User MapUser(Data.Model.User user)
     {
         if (user == null)
         {
             return(new Model.User());
         }
         else
         {
             return new Model.User()
                    {
                        CultureName = user.CultureName,
                        DisplayName = user.DisplayName,
                        Enabled     = user.Enabled,
                        Roles       = user.Roles.Select(o => o.RoleId),
                        TimeZoneId  = user.TimeZoneId,
                        UserId      = user.UserId,
                        Username    = user.Username
                    }
         };
     }
 }
示例#18
0
        private static void InitializeDatabase()
        {
            var exampleUser = new Data.Model.User
            {
                FirstName      = "Onur",
                LastName       = "Kayabasi",
                Email          = "*****@*****.**",
                HashedPassword = Infrastructure.Service.EncryptionHelper.CreateHashed("testparola123"),
                Role           = Infrastructure.Service.Constants.JwtAuthenticationService.UserRole.Admin
            };

            Data.Utility.Initializer.ecommerceDb.InitializeRepository <Data.Model.User>(new List <Data.Model.User>
            {
                exampleUser
            });

            var laptopCategory = new Data.Model.Category
            {
                Name = "Laptop"
            };

            Data.Utility.Initializer.ecommerceDb.InitializeRepository <Data.Model.Category>(new List <Data.Model.Category>
            {
                laptopCategory
            });

            var msiProduct = new Data.Model.Product
            {
                Name        = "MSI GP62 7RD",
                Description = "Description of MSI GP62 7RD",
                Price       = 7000,
                Category    = laptopCategory
            };

            Data.Utility.Initializer.ecommerceDb.InitializeRepository <Data.Model.Product>(new List <Data.Model.Product>
            {
                msiProduct
            });

            var exampleBasket = new Data.Model.Basket
            {
                Products = new List <Data.Model.Product>
                {
                    msiProduct
                }
            };

            Data.Utility.Initializer.ecommerceDb.InitializeRepository <Data.Model.Basket>(new List <Data.Model.Basket>
            {
                exampleBasket
            });

            var exampleAddress = new Data.Model.Address
            {
                Country  = "Turkey",
                City     = "Istanbul",
                District = "Pendik",
                Zip      = 34909
            };

            Data.Utility.Initializer.ecommerceDb.InitializeRepository <Data.Model.Address>(new List <Data.Model.Address>
            {
                exampleAddress
            });

            Data.Utility.Initializer.ecommerceDb.InitializeRepository <Data.Model.Order>(new List <Data.Model.Order>
            {
                new Data.Model.Order
                {
                    Owner   = exampleUser,
                    Basket  = exampleBasket,
                    Address = exampleAddress,
                }
            });
        }
示例#19
0
        public async Task <IUserExtended> ResolveUserBy(long userId)
        {
            Data.Model.User dbUser = this.db.User.SingleOrDefault(o => o.UserId == userId);

            return(await Task.FromResult(this.MapUser(dbUser)));
        }
        public static string SignDocument(Guid idSignatory)
        {
            using (UpsilabEntities db = new UpsilabEntities())
            {
                var currentSignatory = (from sign in db.Signatory//.Include("User")
                                        where sign.idSignatory == idSignatory
                                        select sign).FirstOrDefault();

                var lstFieldLabelsCurrentSignatory = new List<string>();

                if (currentSignatory == null)
                {
                    throw new Exception(LanguageContentBL.Translate("signature_not_allowed_to_sign"));
                }

                // Check if already signed by user
                if (currentSignatory.DateSignature.HasValue)
                {
                    throw new Exception(string.Format(LanguageContentBL.Translate("signature_doc_signed_on"), currentSignatory.DateSignature.Value.ToShortDateString()));
                }

                //Liste des signataires
                SignatureTransaction signatureTransaction = (from signTrans in db.SignatureTransaction
                                                                                //.Include("Signatory")
                                                                                //.Include("Document")
                                                                                //.Include("Document.DocumentSignatory")
                                                                                //.Include("Document.DocumentModel")
                                                                  where signTrans.idSignatureTransaction == currentSignatory.idSignatureTransaction
                                                                  select signTrans).FirstOrDefault();
              
                // Data needed
                //1- Business Id
                string businessId = string.Format("{0}-{1}", DOCUMENT, currentSignatory.idSignatureTransaction);
                
                //2- back Url
                string backUrl = string.Format("{0}/Signature/RetourSignatureDocument{1}", Upsilab.Business.Utility.UrlHelper.GetSiteUrl(), DTPClient.GET_Variables); //TODO : User ??
                
                //3- List of documents to sign
                var documentsToSign = new List<DocumentToSign>();

                // Document different from documentType = DOC (This type of document is only to send to "coffre fort" not to sign)
                // And document which have config signatory : page, x, y...
                var docDocType = ElectronicSafeDocumentBL.DocumentType.DOC.ToString();

                var documents = (from doc in signatureTransaction.Document
                                 where doc.DocumentType != docDocType && doc.DocumentSignatory.Count > 0
                                 select doc).ToList();

                //TODO : TEST-------------------------------------
                //documents = documents.Where(x => x.DocumentType == "CPART").ToList();
                //FIN TEST----------------------------------------

                // Check if there is a document to sign
                if (documents.Count == 0)
                {
                    throw new Exception(LanguageContentBL.Translate("signature_no_doc"));
                }

                for (int i = 0; i < documents.Count; i++)
                {
                    List<SignatureParameter> signatureParameters = new List<SignatureParameter>();
                    bool isSignParamsFromFile = false;
                    var document = documents.ElementAt(i);
                    var documentModel = document.DocumentModel;

                    if (document.GeneratedFromModel) //Doc generated from model
                    {
                        //Dans certains cas, les parametres de signature sont donnés sur un fichier json par rapport au modele de document
                        if (documentModel != null)
                        {
                            var jsonSignParams = Upsilab.Business.Sdg.DocumentModelFileBL.GetSignatureParametersContentFromFile(documentModel);
                            signatureParameters = SignatureParameter.JsonToSignatureParameters(jsonSignParams);

                            if (signatureParameters.Count > 0)
                            {
                                isSignParamsFromFile = true;
                            }
                        }
                    }

                    //Position de la zone de signature de chaque signataire sur le document
                    foreach (var signataire in signatureTransaction.Signatory)
                    {

                        //Signature fieldLabel
                        var signatureFieldLabel = string.Format("{0}-{1}", DTPClient.USER, signataire.idSignatory);

                        if (isSignParamsFromFile) //just update "SignatureFieldLabel"
                        {
                            var signatoryRole = signataire.Role;
                            var j = 0;
                            signatureParameters.Where(sp => sp.SignatoryRole == signatoryRole).ToList().ForEach(sp =>
                                {
                                    //Differencier par un compteur les fieldLabes
                                    sp.SignatureFieldLabel = string.Format("{0}-{1}", signatureFieldLabel, j);
                                    j++;
                                });
                        }
                        else //Create the signatureParameter //TODO : if many fields for defined manually
                        {
                            var documentSignatories = signataire.DocumentSignatory.Where(ds => ds.idDocument == document.idDocument).ToList(); //Liste des zones de signature du signataire
                            var j = 0;

                            documentSignatories.ForEach(documentSignatory =>
                            {
                                var x = documentSignatory.X;
                                var y = documentSignatory.Y;
                                var height = documentSignatory.Height;
                                var width = documentSignatory.Width;

                                //NB : les valeurs provenant de la BD est en "pixel", convertir en "mm" pour dictao ? 
                                //=> pour les documents dont on a defini manuellement les zones
                                //=> pas de conversion pour les documents automatiques
                                if (!document.GeneratedFromModel) //zones de signature definies manuellement
                                {
                                    x = ConverPixelToMillimeter(x);
                                    y = 297 - ConverPixelToMillimeter(height) - ConverPixelToMillimeter(y); //297 <=> height A4 ?
                                    width = ConverPixelToMillimeter(width);
                                    height = ConverPixelToMillimeter(height);
                                }

                                SignatureParameter signatureParameter = new SignatureParameter()
                                {
                                    //SignatureFieldLabel = signatureFieldLabel,
                                    SignatureFieldLabel = string.Format("{0}-{1}", signatureFieldLabel, j),
                                    SignatoryRole = signataire.Role,

                                    SignaturePosition = new SignaturePosition()
                                    {
                                        Page = documentSignatory.Page,
                                        X = x,
                                        Y = y,
                                        Width = width,
                                        Height = height
                                    }
                                };

                                signatureParameters.Add(signatureParameter);
                                j++;
                            }
                            );
                        }

                    }
                    

                    //Document to sign
                    string dtpDocType = (i == 0) ? DTPClient.DocumentTypes.CONTRACT.ToString() : string.Format("{0}{1}", DTPClient.APPENDIX, i);

                    //Label of the document to send to DICTAO ?
                    //Particular case for AVENANT : get the document name
                    var label = (string.IsNullOrEmpty(document.Status)) ? LanguageContentBL.Translate("signature_doc_title") : LanguageContentBL.Translate(document.DocumentType.ToLower());

                    var avenantDocumentTypes = DocumentSignatureTransactionBL.GetDocumentTypes(DocumentSignatureTransactionBL.SignatureTransactionType.AVENANT);

                    if (avenantDocumentTypes.Contains(document.DocumentType))
                    {
                        label = document.Designation;
                    }
                  
                    DocumentToSign doc = new DocumentToSign()
                    {
                        Label = label,
                        Description = label,
                        PathFilename = FileManager.GetFileFromUploadDirectory(document.Location, document.Name),
                        Type = dtpDocType,
                        SignatureParameters = signatureParameters
                    };

                    documentsToSign.Add(doc);

                    //List des signatureFields for currentSignatory
                    signatureParameters.ForEach(sp => 
                    {
                        if (sp.SignatoryRole == currentSignatory.Role)
                        {
                            if (!lstFieldLabelsCurrentSignatory.Contains(sp.SignatureFieldLabel))
                            {
                                lstFieldLabelsCurrentSignatory.Add(sp.SignatureFieldLabel);
                            }
                        }
                    });

                }
                                                
                //DTP Data
                DTPData dtpData = new DTPData()
                {
                    TransactionId = currentSignatory.SignatureTransaction.idDTPTransaction,
                    UserAccessId = currentSignatory.idDTPUserAccess,
                    BusinessId = businessId,
                    BackUrl = backUrl,
                    DocumentsToSign = documentsToSign,
                    SignatureFieldLabels = lstFieldLabelsCurrentSignatory,//new List<string> { string.Format("{0}-{1}", DTPClient.USER, currentSignatory.idSignatory) }, //Exemple : USER-00000-00000-...
                    SignatureRole = currentSignatory.Role,
                    UserSpaceTitle = LanguageContentBL.Translate("signature_doc_sign_title"),
                    Language = SessionManager.GetCurrentLanguage().LanguageTypeName,
                };

               //User info ?
                var user = currentSignatory.User;
                if (user == null)
                {
                    user = new Data.Model.User()
                    {
                        UserName = currentSignatory.Name,
                        UserFirstName = !string.IsNullOrEmpty(currentSignatory.Firstname) ? currentSignatory.Firstname : " ", //TODO : test
                        UserMobilePhone = currentSignatory.Mobile,
                        UserEmail = currentSignatory.Email,

                        idUser = Guid.Empty,
                        idUserProfile = 7,
                        UserPassword = string.Empty,
                        DateCreated = DateTime.Now,
                    };
                }

                // Check if any users has signed first. if not, he signs first
                var anySignatoryHasSigned = signatureTransaction.Signatory.Where(sign => sign.DateSignature.HasValue).FirstOrDefault();

                if (anySignatoryHasSigned == null)
                {
                    //Sign document
                    dtpData = SignatureDocumentBL.SignByFirstUser(user, dtpData);

                    //Save transaction Id to table
                    signatureTransaction.idDTPTransaction = dtpData.TransactionId;
                    currentSignatory.idDTPUserAccess = dtpData.UserAccessId;
                }
                else
                {
                    dtpData = SignatureDocumentBL.SignBySecondUser(user, dtpData);

                    //Save userAccess Id to table                    
                    currentSignatory.idDTPUserAccess = dtpData.UserAccessId;
                }

                db.SaveChanges();

                return dtpData.IHM_Url;
            }
        }
示例#21
0
 public void Delete(int id)
 {
     Data.Model.User guestNote = Get(id);
     _dataContext.Users.Remove(guestNote);
     _dataContext.SaveChanges();
 }
示例#22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack && Request.Form[ddlLanguages.UniqueID] != null)
            {
                ddlLanguages.SelectedValue = Request.Form[ddlLanguages.UniqueID];
                mainCss.Href = $"/Content/site-{ ddlLanguages.SelectedValue}.css";
                string culture = "ar-EG";
                if (ddlLanguages.SelectedValue == "en")
                {
                    culture = "en-GB";
                }
                Thread.CurrentThread.CurrentCulture         = new System.Globalization.CultureInfo(culture);
                Thread.CurrentThread.CurrentUICulture       = new System.Globalization.CultureInfo(culture);
                Response.Cookies["SelectedCulture"].Value   = culture;
                Response.Cookies["SelectedCulture"].Expires = DateTime.Today.AddYears(1);
            }
            else
            {
                ddlLanguages.SelectedValue = IsoName;
                mainCss.Href = $"/Content/site-{IsoName}.css";
            }
            UserServices   userServices    = new UserServices();
            MembershipUser membershipUser  = Membership.GetUser();
            var            providerUserKey = membershipUser?.ProviderUserKey;

            if (providerUserKey != null)
            {
                CurrentUser = userServices.GetUser((Guid)providerUserKey);
                Khadmatcom.Data.Model.spGetLoggedinSummary_Result currentSummary = _settingServices.GetSummary(CurrentUser.Id);

                if (currentSummary.ClientNew.HasValue)
                {
                    ClientNew = currentSummary.ClientNew.Value;
                }
                if (currentSummary.ProviderNew.HasValue)
                {
                    ProviderNew = currentSummary.ProviderNew.Value;
                }
                if (currentSummary.ClientApproved.HasValue)
                {
                    ClientApproved = currentSummary.ClientApproved.Value;
                }
                if (currentSummary.ProviderApproved.HasValue)
                {
                    ProviderApproved = currentSummary.ProviderApproved.Value;
                }
                if (currentSummary.ClientPaid.HasValue)
                {
                    ClientPaid = currentSummary.ClientPaid.Value;
                }
                if (currentSummary.ProviderPaid.HasValue)
                {
                    ProviderPaid = currentSummary.ProviderPaid.Value;
                }
                if (currentSummary.ClientInProgress.HasValue)
                {
                    ClientInProgress = currentSummary.ClientInProgress.Value;
                }
                if (currentSummary.ProviderInProgress.HasValue)
                {
                    ProviderInProgress = currentSummary.ProviderInProgress.Value;
                }
                if (currentSummary.ClinetAccomplished.HasValue)
                {
                    ClinetAccomplished = currentSummary.ClinetAccomplished.Value;
                }
                if (currentSummary.ProviderAccomplished.HasValue)
                {
                    ProviderAccomplished = currentSummary.ProviderAccomplished.Value;
                }
                if (currentSummary.ClientRefused.HasValue)
                {
                    ClientRefused = currentSummary.ClientRefused.Value;
                }
                if (currentSummary.ProviderRefused.HasValue)
                {
                    ProviderRefused = currentSummary.ProviderRefused.Value;
                }
                if (currentSummary.ClientCanceled.HasValue)
                {
                    ClientCanceled = currentSummary.ClientCanceled.Value;
                }
                if (currentSummary.ProviderCanceled.HasValue)
                {
                    ProviderCanceled = currentSummary.ProviderCanceled.Value;
                }
                if (currentSummary.ClientExpired.HasValue)
                {
                    ClientExpired = currentSummary.ClientExpired.Value;
                }
                if (currentSummary.ProviderExpired.HasValue)
                {
                    ProviderExpired = currentSummary.ProviderExpired.Value;
                }
            }
        }
示例#23
0
        public async Task <IUserExtended> ResolveUserBy(string username)
        {
            Data.Model.User dbUser = await this.db.User.Where(o => o.Username == username).SingleOrDefaultAsync();

            return(this.MapUser(dbUser));
        }
示例#24
0
 public void Delete(int id)
 {
     Data.Model.User user = Get(id);
     _dataContext.Users.Remove(user);
     _dataContext.SaveChanges();
 }
        public static int Generate_MissionReport(Upsilab.Data.Model.MissionDocument pMissionDoc, string pathFileName, bool forceDownload, bool pIsEmptyDocument = false)
        {
            float y = 260;
            int height = 20;
            int width = 500;
            int interligne = 15;
            float label_width = 200;
            float answer_width = 280;
            float answer_x = 200;
            // int paddingLeft = 50;
            FirmInstitution firmInstitution = pMissionDoc.CustomerProspect.FirmInstitution;

            //Title and footer document
            string documentTitle = "Rapport de mission";
            string footerContent = firmInstitution.DocumentFooterContent;

            string name = string.Empty;
            string date = string.Empty;
            string idDocument = string.Empty;

            if (!pIsEmptyDocument)
            {
                if (pMissionDoc.CustomerProspect.IsCorporation.HasValue && pMissionDoc.CustomerProspect.IsCorporation.Value)
                    name = pMissionDoc.CustomerProspect.CompanyName;
                else
                    name = string.Format("{0} {1}", pMissionDoc.CustomerProspect.User.UserName, pMissionDoc.CustomerProspect.User.UserFirstName);

                date = DateTime.Now.ToShortDateString();
                idDocument = pMissionDoc.idMissionDocument.ToString();
            }
            if (forceDownload)
                date = string.Empty;
            FoxitPDFGenerator pdfGen = new FoxitPDFGenerator(documentTitle, footerContent, name, string.Format("{0} {1}", string.IsNullOrEmpty(date) ? string.Empty : LanguageContentBL.Translate("PdfReportPP_004"), date));

            //FoxitPDFGenerator pdfGen = new FoxitPDFGenerator(documentTitle, footerContent);

            #region page 1
            string logoPathFileName = Upsilab.Business.Utility.FileManager.BuildLogoPath(firmInstitution.idFirmInstitution) + firmInstitution.Logo;
            pdfGen.AddBackgroungImage();
            pdfGen.AddLogoOnFirstPage(logoPathFileName, firmInstitution.LogoAlign);



            y = 380;
            pdfGen.AddWhiteTitle(LanguageContentBL.Translate("PdfRapportMission_001"), y, 240, 60, 260, 20);

            pdfGen.AddWhiteTitle((pMissionDoc.CustomerProspect.IsCorporation.HasValue && pMissionDoc.CustomerProspect.IsCorporation.Value) ? LanguageContentBL.Translate("PdfLM_134") : LanguageContentBL.Translate("PdfReportPP_003"), y += (2 * interligne + 15), 500, 20, 0, 12);//PERSONNE PHYSIQUE ou PERSONNE MORALE

            pdfGen.AddWhiteBorder(y += interligne * 1.7f, 210, 290, 70);

            if (pIsEmptyDocument)
            {
            }
            else
            {
                if (!forceDownload)
                    pdfGen.AddWhiteTitleLeft(DateTime.Now.ToShortDateString(), y += 10, 500, 11, 220, 10);
                pdfGen.AddWhiteTitleLeft(name, y += (interligne), 500, 11, 220, 10);
                pdfGen.AddWhiteTitleLeft(string.Format("{0}-{1}", LanguageContentBL.Translate("PdfRapportMission_003"), idDocument), y += (interligne), 500, 11, 220, 10);
            }

            #endregion

            #region page 2

            Data.Model.CustomerProspect cust = new Data.Model.CustomerProspect();
            Data.Model.User userAdviser = new Data.Model.User();
            List<CustomerProspectOptionValue> data = new List<CustomerProspectOptionValue>();

            if (!pIsEmptyDocument)
            {
                cust = pMissionDoc.CustomerProspect;
                data = Upsilab.Business.CustomerProspect.CustomerProspectOptionBL.GetOptionValueListWithIdCustomerProspectAndIdParentOptionPlus(cust.idCustomer, Upsilab.Business.CustomerProspect.CustomerProspectBL.MissionParentQuestionId);
                userAdviser = (pMissionDoc.User != null) ? pMissionDoc.User : pMissionDoc.CustomerProspect.User1;
            }

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfMissionClient"), y, width, height);
            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionNom"), (pIsEmptyDocument) ? string.Empty : (cust.IsCorporation.HasValue && cust.IsCorporation.Value) ? cust.CompanyName : cust.User.UserName), y += interligne * 1.5f, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionNom"), string.Empty), y += interligne * 1.5f, label_width, height);
            pdfGen.AddAnswer((pIsEmptyDocument) ? string.Empty : (cust.IsCorporation.HasValue && cust.IsCorporation.Value) ? cust.CompanyName : cust.User.UserName, y, answer_width, height, answer_x);

            // pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionPrenom"), (pIsEmptyDocument) ? string.Empty : (cust.IsCorporation.HasValue && cust.IsCorporation.Value) ? LanguageContentBL.Translate("PdfMission") : cust.User.UserFirstName), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionPrenom"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer((pIsEmptyDocument) ? string.Empty : (cust.IsCorporation.HasValue && cust.IsCorporation.Value) ? string.Empty : cust.User.UserFirstName, y, answer_width, height, answer_x);

            //  pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionAdresse"), (pIsEmptyDocument) ? string.Empty : cust.Adress), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionAdresse"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer((pIsEmptyDocument) ? string.Empty : cust.Adress, y, answer_width, height * 3, answer_x);

            // pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionCP"), (pIsEmptyDocument) ? string.Empty : cust.ZipCode), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionCP"), string.Empty), y += interligne * 2.8f, label_width, height);
            pdfGen.AddAnswer((pIsEmptyDocument) ? string.Empty : cust.ZipCode, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionVille"), (pIsEmptyDocument) ? string.Empty : cust.City), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionVille"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer((pIsEmptyDocument) ? string.Empty : cust.City, y, answer_width, height, answer_x);

            FirmInstitution firm = new FirmInstitution();
            if (!pIsEmptyDocument)
            {
                firm = cust.FirmInstitution;
            }
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfMissionConseiller"), y += interligne * 1.5f, width, height);
            // pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionNomEtabs"), firm.FirmInstitutionName), y += interligne * 1.5f, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionNomEtabs"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.FirmInstitutionName, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionNomCons"), userAdviser.UserName), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionNomCons"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(userAdviser.UserName, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionPrenomCons"), userAdviser.UserFirstName), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionPrenomCons"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(userAdviser.UserFirstName, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionNomDir"), firm.LeaderName), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionNomDir"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.LeaderName, y, answer_width, height, answer_x);

            // pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionPrenomDir"), firm.LeaderFirstName), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionPrenomDir"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.LeaderFirstName, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionAdrssSiege"), firm.FirmStreet), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionAdrssSiege"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.FirmStreet, y, answer_width, height * 3, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionCP"), firm.FirmPostCode), y += interligne*2.8f, width, height);//CP
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionCP"), string.Empty), y += interligne * 2.8f, label_width, height);
            pdfGen.AddAnswer(firm.FirmPostCode, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionVille"), firm.FirmCity), y += interligne, width, height);//Ville
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionVille"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.FirmCity, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionRCS"), firm.RCS), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionRCS"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.RCS, y, answer_width, height, answer_x);


            if (SessionManager.GetHostCodeSession() != PageLanguageHelper.HostCode.BE.ToString())
            {
                //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionRegistre"), firm.RegisteredInRegister), y += interligne, width, height);
                pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionRegistre"), string.Empty), y += interligne, label_width, height);
                pdfGen.AddAnswer(firm.RegisteredInRegister, y, answer_width, height, answer_x);

                //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionAgregateur"), ""), y += interligne, width, height);
                pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfMissionAgregateur"), string.Empty), y += interligne, label_width, height);
                pdfGen.AddAnswer("", y, answer_width, height, answer_x);

            }

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfMmeMsieur"), y += interligne * 2f, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_004"), y += interligne * 2f, width, height * 3);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_005"), y += interligne * 2f, width, height * 3);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_006"), y += interligne * 3f, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_007"), y += interligne * 1.5f, width, height * 2);

            #endregion

            #region page 3

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfRapportmission_008"), y, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_009"), y += interligne * 1.5f, width, height * 2);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_010"), y += interligne * 1.5f, width, height * 2);
            pdfGen.AddBlueBorder(y += interligne, 0, width, height * 2);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue("Client_Mission_008", data), y + 5 * 1.5f, width, height, 5);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_011"), y += interligne * 3f, width, height);

            pdfGen.AddBlueBorder(y += interligne * 1.5f, 0, width, height * 2);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(192, 126, data), y + 2 * 1.5f, width, height, 5);
            pdfGen.AddBlueBorder(y += interligne * 3f, 0, width, height * 2);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(192, 127, data), y + 2 * 1.5f, width, height, 5);
            pdfGen.AddBlueBorder(y += interligne * 3f, 0, width, height * 2);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(192, 128, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddBlueBorder(y += interligne * 3f, 0, width, height * 2);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(192, 129, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddBlueBorder(y += interligne * 3f, 0, width, height * 2);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(192, 130, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddBlueBorder(y += interligne * 3f, 0, width, height * 2);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(192, 131, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddBlueBorder(y += interligne * 3f, 0, width, height * 2);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(192, 132, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddBlueBorder(y += interligne * 3f, 0, width, height * 2);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(192, 133, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddBlueBorder(y += interligne * 3f, 0, width, height * 2);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(192, 134, data), y + 2 * 2.6f, width, height, 5);
            pdfGen.AddBlueBorder(y += interligne * 3f, 0, width, height * 2);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(192, 135, data), y + 2 * 2.6f, width, height, 5);

            #endregion

            #region page 4

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfRapportmission_012"), y, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_013"), y += interligne * 1.5f, width, height * 3);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_012", data), y += interligne * 3, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_014"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_013", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_015"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_014", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_016"), y, width, height, 15);

            if (SessionManager.GetHostCodeSession() != PageLanguageHelper.HostCode.BE.ToString())
            {
                PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_015", data), y += interligne, 0, "1");
                pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_017"), y, width, height, 15);
                PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_016", data), y += interligne, 0, "1");
                pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_018"), y, width, height, 15);
            }
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_017", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_019"), y, width, height, 15);

            if (SessionManager.GetHostCodeSession() != PageLanguageHelper.HostCode.BE.ToString())
            {
                PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_1241", data), y += interligne, 0, "1");
                pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_1241"), y, width, height, 15);
            }

            // PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue("Client_Mission_018", data), y += interligne, 0, "1"); --> pas de checkbox sur le formulaire
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_020"), y += interligne, width, height);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue("Client_Mission_018", data), y, 480, height * 2, 40);




            if (SessionManager.GetHostCodeSession() != PageLanguageHelper.HostCode.BE.ToString())
            {
                pdfGen.AddLabelNote(LanguageContentBL.Translate("PdfReportPP_Notes"), y += interligne * 2, 500, 20);
                pdfGen.AddBlueBorder(y += interligne, 0, width, 280);
                pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue("Client_Mission_019", data), y + 5, 480, 280, 10);
            }

            #endregion

            #region page 5
            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfRapportmission_021"), y, width, height);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_020", data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_022"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_021", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_023"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_022", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_024"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_023", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_025"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_024", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_026"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_025", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_027"), y, width, height, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Mission_026", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_028"), y, width, height, 15);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(208, 138, data), y += interligne, 480, height * 2, 15);

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddLabelNote(LanguageContentBL.Translate("PdfReportPP_Notes"), y += interligne, 500, 20);
            pdfGen.AddBlueBorder(y += interligne, 0, width, 600);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(194, 139, data), y + 5, 480, 600, 10);

            #endregion

            #region page 6
            pdfGen.CreatePage();
            y = 0;

            //Analyse de la situation
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfRapportmission_029"), y, width, height);
            pdfGen.AddLabelNote(LanguageContentBL.Translate("PdfReportPP_Notes"), y += interligne * 2, 500, 20);
            pdfGen.AddBlueBorder(y += interligne, 0, width, 600);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(195, 140, data), y + 5, 480, 600, 10);
            #endregion

            #region page 7

            pdfGen.CreatePage();
            y = 0;

            //Rappel de la remuneration
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfRapportmission_029_0"), y, width, height);
            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfRapportmission_029_1"), y += interligne * 2, 500, 20);

            //From LM
            //Le mode de facturation et de rémunération
            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_072"), y += (interligne * 2) - 5, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_073"), y += interligne * 2, width, 20);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_074"), y += interligne, width, 20 * 3);

            pdfGen.AddBlueBorder(y += interligne * 3, 0, 30, 20);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(1234, 756, data), y + 5, 50, 20, 5);
            pdfGen.AddDefaultText("X", y + 8, 20, 20, 40);
            pdfGen.AddBlueBorder(y, 60, 30, 20);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(1234, 757, data), y + 5, 50, 30, 65);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_075"), y + 8, width, height, 110);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_076"), y += interligne * 3, width, height * 2);
            // pdfGen.AddDefaultText("Au titre de l’accompagnement du client, une information plus précise sera fournie ultérieurement sur simple demande une fois connus les supports choisis par le client.", y += interligne * 3, width, height * 2, 15);
            pdfGen.AddReference(LanguageContentBL.Translate("PdfLM_077"), y += interligne * 2, width, height * 2, 15);

            //Les honoraires : n'afficher que les honoraires fournis
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_078"), y += interligne * 3, width, height);

            string honoraire_1_Value = CustomerProspectOptionBL.GetOptionValue(1236, data);
            string honoraire_2_Value = CustomerProspectOptionBL.GetOptionValue(1237, data);
            string honoraire_3_Value = CustomerProspectOptionBL.GetOptionValue(1238, data);
            string honoraire_4_Value = CustomerProspectOptionBL.GetOptionValue(1240, data);

            //1-
            if (honoraire_1_Value == "1" || pIsEmptyDocument)
            {
                PlotBooleanValue(pdfGen, honoraire_1_Value, y += (interligne * 1.5f) + 10, 0, "1");
                pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_079")
                    , (pIsEmptyDocument) ? Espace : CustomerProspectOptionBL.GetAttributeValue(1236, 760, data)
                    , (pIsEmptyDocument) ? Espace : CustomerProspectOptionBL.GetAttributeValue(1236, 761, data)
                    , (pIsEmptyDocument) ? Espace : CustomerProspectOptionBL.GetAttributeValue(1236, 762, data))
                    , y - 10, 480, height * 4, 20);
            }

            //Ou
            if (pIsEmptyDocument)
                pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_080"), y += interligne * 3f, width, height);

            //2-
            if (honoraire_2_Value == "1" || pIsEmptyDocument)
            {
                PlotBooleanValue(pdfGen, honoraire_2_Value, y += (interligne * 1.5f) + 10, 0, "1");
                pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_081")
                    , (pIsEmptyDocument) ? Espace : CustomerProspectOptionBL.GetAttributeValue(1237, 763, data)), y - 10, width, height * 3, 20);
            }

            if (pIsEmptyDocument)
                pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_080"), y += interligne * 2.5f, width, height);

            //3-
            if (honoraire_3_Value == "1" || pIsEmptyDocument)
            {
                PlotBooleanValue(pdfGen, honoraire_3_Value, y += (interligne * 1.5f) + 20, 0, "1");
                pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_082")
                    , (pIsEmptyDocument) ? Espace : CustomerProspectOptionBL.GetAttributeValue(1238, 764, data)), y - 20, width, height * 5, 20);
            }

            if (honoraire_4_Value == "0" || pIsEmptyDocument)
            {
                //Nous sommes convenus d'un règlement d'un montant de {0} Euros HT à l'acceptation de la lettre de mission et le solde lors du rendez-vous de synthèse de la mission.
                pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_083")
                    , (pIsEmptyDocument) ? Espace : CustomerProspectOptionBL.GetAttributeValue(1235, 758, data)), y += interligne * 4, width, height * 2);

                pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_084")
                   , CustomerProspectOptionBL.GetAttributeValue(1235, 759, data)), y += interligne * 2, width, height);
            }

            //Ou
            if (pIsEmptyDocument)
                pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_080"), y += interligne * 2.5f, width, height);


            //4- Autre ?
            if (honoraire_4_Value == "1" || pIsEmptyDocument)
            {
                PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(1240, data), y += (interligne * 1.5f) + 10, 0, "1");
                pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_084_1")), y, 480, 20, 20);
                //pdfGen.AddDefaultText(string.Format(CustomerProspectOptionBL.GetAttributeValue(1240, 766, data)), y += interligne, width, 280, 20);
                pdfGen.AddBlueBorder(y += interligne, 20, width - 20, 100);
                pdfGen.AddDefaultText(pIsEmptyDocument ? Espace : CustomerProspectOptionBL.GetAttributeValue(1240, 766, data), y + 5, width - 30, 100, 25);

            }

            #endregion

            #region page 8

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfRapportmission_030"), y, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_031"), y += interligne * 2, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_032"), y += interligne, width, height);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_033"), y += interligne * 2, width, height * 2);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_034"), y += interligne * 2, width, height * 2);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfRapportmission_035"), y += interligne * 2, width, height * 2);

            #endregion

            #region page 9

            pdfGen.CreatePage();
            y = 0;
            //Signature
            pdfGen.AddTitle(@"Signatures", 0);

            pdfGen.AddDefaultBoldText(@"Signature de l'Etablissement", 100, 500, 20, 80);


            pdfGen.AddBlueBorder(130, 35, 200, 170);

            //Ne pas afficher si signature electronique
            if (forceDownload)
            {
                pdfGen.AddDefaultText(@"J'ai lu et j'accepte les conditions générales.", 135, 200, 20, 40);
                pdfGen.AddDefaultText(@"Lu et approuvé.", 145, 145, 20, 40);
                pdfGen.AddDefaultText(@"Date:", 160, 145, 20, 40);
            }

            pdfGen.AddDefaultBoldText(@"Signature du Client", 100, 500, 20, 340);
            pdfGen.AddBlueBorder(130, 280, 200, 170);

            //Ne pas afficher si signature electronique
            if (forceDownload)
            {
                pdfGen.AddDefaultText(@"J'ai lu et j'accepte les conditions générales.", 135, 200, 20, 285);
                pdfGen.AddDefaultText(@"Lu et approuvé.", 145, 145, 20, 285);
                pdfGen.AddDefaultText(@"Date:", 160, 145, 20, 285);
            }

            #endregion

            //Force download if pathFileName is not set
            if (forceDownload)
            {
                string fileName = string.Format("RapportDeMission_{0}.pdf", pMissionDoc.idMissionDocument);
                pdfGen.GeneratePdfToWeb(fileName);
            }
            else
            {
                pdfGen.GeneratePdf(pathFileName);
            }
            return pdfGen.PageCount;
        }
示例#26
0
        public async Task <IUserExtended> ResolveUserBy(string username)
        {
            Data.Model.User dbUser = this.ResolveUser(username);

            return(await Task.FromResult(this.MapUser(dbUser)));
        }
        public static int GeneratePM_EngagementLetter(Upsilab.Data.Model.MissionDocument pMissionDoc, string pathFileName, bool forceDownload, bool pIsEmptyDocument = false)
        {
            float y = 240;
            int height = 20;
            int width = 500;
            int interligne = 15;
            int paddingLeft = 50;
            float label_width = 200;
            float answer_width = 280;
            float answer_x = 200;

            FirmInstitution firmInstitution = pMissionDoc.CustomerProspect.FirmInstitution;
            string footerContent = pMissionDoc.CustomerProspect.FirmInstitution.DocumentFooterContent;
            Data.Model.User userAdviser = (pMissionDoc.User != null) ? pMissionDoc.User : pMissionDoc.CustomerProspect.User1;


            //Title and footer document
            string documentTitle = "Lettre de mission";
            string name = string.Empty;
            string date = string.Empty;
            string idDocument = string.Empty;

            if (!pIsEmptyDocument)
            {
                name = pMissionDoc.CustomerProspect.CompanyName;
                date = DateTime.Now.ToShortDateString();
                idDocument = pMissionDoc.idMissionDocument.ToString();
            }

            if (forceDownload)
                date = string.Empty;
            //FoxitPDFGenerator pdfGen = new FoxitPDFGenerator(documentTitle, footerContent);
            FoxitPDFGenerator pdfGen = new FoxitPDFGenerator(documentTitle, footerContent, name, string.Format("{0} {1}", string.IsNullOrEmpty(date) ? string.Empty : LanguageContentBL.Translate("PdfReportPP_004"), date));

            #region page 1
            //Logo
            string logoPathFileName = Upsilab.Business.Utility.FileManager.BuildLogoPath(firmInstitution.idFirmInstitution) + firmInstitution.Logo;
            pdfGen.AddBackgroungImage();
            pdfGen.AddLogoOnFirstPage(logoPathFileName, firmInstitution.LogoAlign);


            if (pIsEmptyDocument)
            {
                firmInstitution = new FirmInstitution();
                userAdviser = new Data.Model.User();
            }

            //pdfGen.AddReceuil_Title_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_001"), y, width, 100);
            //pdfGen.AddReceuil_SubTitle_Center_CalibriBold_Label(LanguageContentBL.Translate("PdfLM_134"), y += 50, width, height);

            //if (pIsEmptyDocument)
            //{
            //    string[] rowContents = { LanguageContentBL.Translate("PdfRapportMission_002") //Date de maj ou Date de création
            //                         , LanguageContentBL.Translate("PdfFirm_082")
            //                         , string.Empty
            //                       };
            //    pdfGen.LM_AddTableTitle(rowContents, 90, y += 50);
            //}
            //else
            //{
            //    string[] rowContents = { string.Format(LanguageContentBL.Translate("PdfRapportMission_002"), DateTime.Now.ToShortDateString()) //Date de maj ou Date de création
            //                         , string.Format("{0} LM-{1}",LanguageContentBL.Translate("PdfFirm_082"),pMissionDoc.idMissionDocument)
            //                         , string.Format("{0}", pMissionDoc.CustomerProspect.CompanyName)
            //                       };
            //    pdfGen.LM_AddTableTitle(rowContents, 90, y += 50);
            //}

            y = 380;
            pdfGen.AddWhiteTitle(LanguageContentBL.Translate("PdfLM_001"), y, 240, 60, 260, 20);

            pdfGen.AddWhiteTitle(LanguageContentBL.Translate("PdfLM_134"), y += (2 * interligne + 15), 500, 20, 0, 12);//PERSONNE MORALE

            pdfGen.AddWhiteBorder(y += interligne * 1.7f, 210, 290, 70);

            if (pIsEmptyDocument)
            {
            }
            else
            {
                if (!forceDownload)
                    pdfGen.AddWhiteTitleLeft(DateTime.Now.ToShortDateString(), y += 10, 500, 11, 220, 10);
                pdfGen.AddWhiteTitleLeft(name, y += (interligne), 500, 11, 220, 10);
                pdfGen.AddWhiteTitleLeft(string.Format("LM-{0}", pMissionDoc.idMissionDocument), y += (interligne), 500, 11, 220, 10);
            }


            //pdfGen.AddBlueBorder(y += 100, 105, 375, 30);
            //pdfGen.AddReceuil_DetailText_Justify_Calibri_Label(string.Format("{0}", pMissionDoc.CustomerProspect.CompanyName), y + 5, 300, 20, 120);
            #endregion

            #region page 2

            Data.Model.CustomerProspect cust = new Data.Model.CustomerProspect();
            cust.User = new Data.Model.User();
            List<CustomerProspectOptionValue> data = new List<CustomerProspectOptionValue>();
            if (!pIsEmptyDocument)
            {
                cust = pMissionDoc.CustomerProspect;
                data = Upsilab.Business.CustomerProspect.CustomerProspectOptionBL.GetOptionValueListWithIdCustomerProspectAndIdParentOption(cust.idCustomer,
                    Upsilab.Business.CustomerProspect.CustomerProspectBL.EngagementLetterParentQuestionId);
            }

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_003"), y, width, height);
            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_004"), cust.CompanyName), y += interligne * 1.5f, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_004"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(cust.CompanyName, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format("Prénom : {0}", "XXX"), y += interligne, width, height);
            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_006"), cust.Adress), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_006"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(cust.Adress, y, answer_width, height * 3, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_007"), cust.ZipCode), y += interligne*2.8f, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_007"), string.Empty), y += interligne * 2.8f, label_width, height);
            pdfGen.AddAnswer(cust.ZipCode, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_008"), cust.City), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_008"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(cust.City, y, answer_width, height, answer_x);


            FirmInstitution firm = new FirmInstitution();
            if (!pIsEmptyDocument)
                firm = cust.FirmInstitution;
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_009"), y += interligne * 1.5f, width, height);
            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_010"), firm.FirmInstitutionName), y += interligne * 1.5f, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_010"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.FirmInstitutionName, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_011"), userAdviser.UserName), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_011"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(userAdviser.UserName, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_012"), userAdviser.UserFirstName), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_012"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(userAdviser.UserFirstName, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_013"), firm.LeaderName), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_013"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.LeaderName, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_014"), firm.LeaderFirstName), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_014"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.LeaderFirstName, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_015"), firm.FirmStreet), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_015"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.FirmStreet, y, answer_width, height * 3, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_016"), firm.FirmPostCode), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_016"), string.Empty), y += interligne * 2.8f, label_width, height);
            pdfGen.AddAnswer(firm.FirmPostCode, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_017"), firm.FirmCity), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_017"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.FirmCity, y, answer_width, height, answer_x);

            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_018"), firm.RCS), y += interligne, width, height);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_018"), string.Empty), y += interligne, label_width, height);
            pdfGen.AddAnswer(firm.RCS, y, answer_width, height, answer_x);


            if (SessionManager.GetHostCodeSession() != PageLanguageHelper.HostCode.BE.ToString())
            {
                //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_019"), firm.RegisteredInRegister), y += interligne, width, height);
                pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_019"), string.Empty), y += interligne, label_width, height);
                pdfGen.AddAnswer(firm.RegisteredInRegister, y, answer_width, height, answer_x);

                //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_020"), firm.AgregateurNoms), y += interligne, width, height);
                pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_020"), string.Empty), y += interligne, label_width, height);
                pdfGen.AddAnswer(firm.AgregateurNoms, y, answer_width, height, answer_x);

            }

            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_021"), y += interligne * 2, width, height, paddingLeft);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_022"), y += interligne * 1.5f, width, height);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_023"), y += interligne * 1.5f, width, height * 2);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_024"), y += interligne * 3f, width, height * 2);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_025"), y += interligne * 2.5f, width, height * 2);

            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_026"), y += interligne * 2.5f, width, height);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_027"), y += interligne * 1.5f, width, height * 3);


            #endregion

            #region page 3

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_028"), y, width, height);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(138, data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_029"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(139, data), y += interligne + 5, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_030"), y, width, height * 2, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(140, data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_031"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(141, data), y += interligne + 5, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_032"), y, width, height * 2, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(142, data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_033"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(143, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_034"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(144, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_035"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(145, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_036"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(146, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_037"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(147, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_038"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(148, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_039"), y, width, 20, 15);
            //PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(149, data), y += interligne, 0, "1");
            //pdfGen.AddDefaultText("Réception / transmission d’ordres", y, width, 20, 15);
            //PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetProspectValue(150, data), y += interligne, 0, "1");
            //pdfGen.AddDefaultText("Suivi annuel de patrimoine et produits financiers externes", y, width, 20, 15);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_040"), y += interligne, width, height);
            pdfGen.AddBlueBorder(y += interligne, 0, width, 20);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(128, 96, data), y + 5, width, height, 5);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_040"), y += interligne * 1.5f, width, height);
            pdfGen.AddBlueBorder(y += interligne, 0, width, 20);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(128, 97, data), y + 5, width, height, 5);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_040"), y += interligne * 1.5f, width, height);
            pdfGen.AddBlueBorder(y += interligne, 0, width, 20);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(128, 98, data), y + 5, width, height, 5);

            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_041"), y += interligne * 2, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_042"), y += interligne * 1.5f, width, height);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_031", data), y += interligne * 1.5f + 5, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_043"), y, width, 40, 15);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_032", data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_045"), y, width, 20, 15);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_033", data), y += interligne + 5, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_054"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_034", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_055"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_035", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_135"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_036", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_136"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_037", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_137"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_038", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_138"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_039", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_139"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_040", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_140"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_041", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_141"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_042", data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_142"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue("Client_Letter_PM_043", data), y += interligne);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_143"), y, width, 20, 15);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_040"), y += interligne, width, height);
            pdfGen.AddBlueBorder(y += interligne, 0, width, 20);
            //if (!cust.IsCorporation.Value)//PP
            //    pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(151, 59, data), y + 5, width, height, 5);
            //else
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue("Client_Letter_PM_044", data), y + 5, width, height, 5);

            #endregion

            #region page 4

            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_056"), y, width, height);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(166, data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_057"), y, width, 20 * 2, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(167, data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_058"), y, width, 20 * 3, 15);

            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_059"), y += interligne * 3, width, height);
            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_060"), y += interligne * 1.5f, width, height);
            pdfGen.AddLabelNote(LanguageContentBL.Translate("PdfLM_061"), y += interligne, width, height);
            pdfGen.AddBlueBorder(y += interligne, 0, 480, 280);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(168, 100, data), y + 5, 480, 280, 5);
            #endregion

            #region page 5
            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_062"), y, width, height);
            pdfGen.AddLabelNote(LanguageContentBL.Translate("PdfLM_061"), y += interligne, width, height);//Notes
            pdfGen.AddBlueBorder(y += interligne, 0, 480, 280);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(169, 101, data), y + 5, 480, 280, 5);

            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_063"), y += interligne * 22f, width, height);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(172, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_064"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(173, data), y += interligne + 5, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_065"), y, width, 40, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(174, data), y += interligne * 1.5f, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_066"), y, width, 20, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(175, data), y += interligne + 5, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_067"), y, width, 40, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(176, data), y += (interligne) + 5, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_068"), y, width, 40, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(177, data), y += (interligne) + 5, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_069"), y, width, 40, 15);
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(178, data), y += (interligne) + 5, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_070"), y, width, 40, 15);

            #endregion

            #region page 6
            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_040"), y, width, height);
            pdfGen.AddBlueBorder(y += interligne, 0, width, 20);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(170, 102, data), y + 5, width, height, 5);

            pdfGen.AddLabelNote(LanguageContentBL.Translate("PdfLM_061"), y += interligne * 2f, width, height);
            pdfGen.AddBlueBorder(y += interligne, 0, width, 280);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(170, 103, data), y + 5, 480, 280, 5);
            #endregion

            #region page 7
            pdfGen.CreatePage();
            y = 0;

            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_071"), y, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_061"), y += interligne, width, height);
            pdfGen.AddBlueBorder(y += interligne, 0, 480, 280);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(171, 104, data), y + 5, 480, 125, 5);

            #endregion

            #region page 8

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_072"), y, width, height);//Le mode de facturation et de rémunération
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_073"), y += interligne, width, 20);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_074"), y += interligne, width, 20 * 3);

            pdfGen.AddBlueBorder(y += interligne * 3, 0, 30, 20);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(131, 105, data), y + 5, 50, 20, 5);
            pdfGen.AddDefaultText("X", y + 8, 20, 20, 40);
            pdfGen.AddBlueBorder(y, 60, 30, 20);
            pdfGen.AddDefaultText(CustomerProspectOptionBL.GetAttributeValue(131, 106, data), y + 5, 50, 30, 65);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_075"), y + 8, width, height, 110);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_076"), y += interligne * 3, width, height * 2);
            // pdfGen.AddDefaultText("Au titre de l’accompagnement du client, une information plus précise sera fournie ultérieurement sur simple demande une fois connus les supports choisis par le client.", y += interligne * 3, width, height * 2, 15);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_077"), y += interligne * 2, width, height * 2, 15);


            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_078"), y += interligne * 3, width, height);//Les honoraires

            //Concernant 1
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(181, data), y += (interligne * 1.5f) + 10, 0, "1");
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_079")
                , pIsEmptyDocument ? Espace : CustomerProspectOptionBL.GetAttributeValue(181, 115, data)
                , pIsEmptyDocument ? Espace : CustomerProspectOptionBL.GetAttributeValue(181, 116, data)
                , pIsEmptyDocument ? Espace : CustomerProspectOptionBL.GetAttributeValue(181, 117, data))
                , y - 10, width, height * 4, 20);

            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_080"), y += interligne * 3f, width, height);

            //Concernant 2
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(182, data), y += (interligne * 1.5f) + 10, 0, "1");
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_081")
                , pIsEmptyDocument ? Espace : CustomerProspectOptionBL.GetAttributeValue(182, 118, data)), y - 10, width, height * 3, 20);

            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_080"), y += interligne * 2.5f, width, height);

            //Concernant 3
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(183, data), y += (interligne * 1.5f) + 20, 0, "1");
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_082")
                , pIsEmptyDocument ? Espace : CustomerProspectOptionBL.GetAttributeValue(183, 119, data)), y - 20, width, height * 5, 20);

            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_083")
                , pIsEmptyDocument ? Espace : CustomerProspectOptionBL.GetAttributeValue(133, 120, data)), y += interligne * 4, width, height * 2);

            /*pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_084")
               , ), y += interligne * 2, width, height);*/

            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_084"), string.Empty), y += interligne * 2, label_width, height);
            pdfGen.AddAnswer(CustomerProspectOptionBL.GetAttributeValue(133, 121, data), y, answer_width, height, answer_x);

            /* pdfGen.CreatePage();
             y = 0;*/

            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_080"), y += interligne * 2.5f, width, height);

            //Autre 4
            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(1239, data), y += interligne, 0, "1");
            //pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_084_1")), y, 480, 20, 20);
            //pdfGen.AddDefaultText(pIsEmptyDocument ? Espace : string.Format(CustomerProspectOptionBL.GetAttributeValue(1239, 765, data)), y += interligne, width, 280, 20);
            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_084_1"), string.Empty), y, label_width, height, 15);
            //pdfGen.AddAnswer(pIsEmptyDocument ? Espace : CustomerProspectOptionBL.GetAttributeValue(1239, 765, data), y, answer_width, height, answer_x);
            pdfGen.AddBlueBorder(y += interligne, 20, width - 20, 100);
            pdfGen.AddDefaultText(pIsEmptyDocument ? Espace : CustomerProspectOptionBL.GetAttributeValue(1239, 765, data), y + 5, width - 30, 100, 25);

            //#endregion

            #endregion

            #region page 9

            pdfGen.CreatePage();
            y = 0;
            //Section : La nature et les modalités de la prestation de conseil
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_085"), y, width, height);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_086"), y += interligne, width, height);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(184, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_087"), y, width, height, 15);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(185, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_088"), y, width, height, 15);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(186, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_089"), y, width, height * 2, 15);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(187, data), y += interligne + 5, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_090"), y, width, height * 2, 15);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(188, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_091"), y, width, height, 15);

            PlotBooleanValue(pdfGen, CustomerProspectOptionBL.GetOptionValue(189, data), y += interligne, 0, "1");
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_092"), y, width, height, 15);

            //Section : La durée et le calendrier de la mission
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_093"), y += interligne * 2.5f, width, height);

            pdfGen.AddJustifyText(string.Format(LanguageContentBL.Translate("PdfLM_094")
            , CustomerProspectOptionBL.GetAttributeValue(135, 122, data)), y += interligne * 1.5f, width, height * 2);

            pdfGen.AddJustifyText(string.Format(LanguageContentBL.Translate("PdfLM_095")
            , CustomerProspectOptionBL.GetAttributeValue(135, 123, data)), y += interligne * 1.5f, width, height * 2);

            //Section : Modalité de notre intervention
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_096"), y += interligne * 2.5f, width, height);

            pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfLM_097")
            , CustomerProspectOptionBL.GetAttributeValue(136, 124, data)), y += interligne * 1.5f, width, height * 2);

            //Section : Typologie de client
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_098"), y += interligne * 3, width, height);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_099"), y += interligne * 1.5f, width, height * 4);

            //Section : Déroulement de la mission
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_100"), y += interligne * 3f, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_101"), y += interligne * 1.5f, width, height * 2);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_102"), y += interligne * 2f, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_103"), y += interligne * 1.5f, width, height * 2);

            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_104"), y += interligne * 2f, width, height * 3);//Parallelement,...
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_105"), y += interligne * 2.5f, width, height * 3); //La totalité...
            #endregion

            #region page 10

            pdfGen.CreatePage();
            y = 0;
            //Suite Section : Déroulement de la mission
            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_106"), y, width, height * 2);
            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("PdfLM_107"), y += interligne * 2f, width, 2 * height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_108"), y += interligne * 2f, width, height * 2);

            //Section : Suivi patrimonial envisagé
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_109"), y += interligne * 2f, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_110"), y += interligne * 1.5f, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_111"), y += interligne * 1.5f, width, height * 3);

            //Section : Modalités d'information
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_112"), y += interligne * 2, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_113"), y += interligne * 1.5f, width, height);

            //Section : Dénonciation de la mission
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_114"), y += interligne * 2f, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_115"), y += interligne * 1.5f, width, height * 3);
            if (SessionManager.GetHostCodeSession() != PageLanguageHelper.HostCode.BE.ToString())
            {
                pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_116"), y += interligne * 3f, width, height * 4);
                pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_117"), y += interligne * 4f, width, height * 3);
            }

            //Section : Responsabilité
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_118"), y += interligne * 2f, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_119"), y += interligne * 1.5f, width, height * 4);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_120"), y += interligne * 2f, width, height * 2);

            //Section : Confidentialité
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_121"), y += interligne * 2f, width, height);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfLM_122"), y += interligne * 1.5f, width, height * 2);

            #endregion

            #region page 11

            pdfGen.CreatePage();
            y = 0;
            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_123"), y, width, height);//Litiges
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_124"), y += interligne * 1.5f, width, height * 2);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_125"), y += interligne * 2f, width, height * 2);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_126"), y += interligne * 2f, width, height * 3);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_127"), y += interligne * 3f, width, height * 2);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_128"), y += interligne * 2f, width, height * 2);

            pdfGen.AddSubtitle(LanguageContentBL.Translate("PdfLM_129"), y += interligne * 3, width, height);//Traitement des informations
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_130"), y += interligne * 1.5f, width, height * 5);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_131"), y += interligne * 3f, width, height * 3);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_132"), y += interligne * 3f, width, height * 4);
            pdfGen.AddJustifyText(LanguageContentBL.Translate("PdfLM_133"), y += interligne * 3f, width, height * 4);
            #endregion

            #region page 12

            pdfGen.CreatePage();
            y = 0;
            //Signature
            pdfGen.AddSubtitle(LanguageContentBL.Translate("Pdf_Signature"), 0);

            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("Pdf_Signature_Etabs"), 100, 500, 20, 80);


            pdfGen.AddBlueBorder(130, 35, 200, 170);

            //Ne pas afficher si signature electronique
            if (forceDownload)
            {
                pdfGen.AddDefaultText(LanguageContentBL.Translate("Pdf_Lu_Et_Accepte"), 135, 200, 20, 40);
                pdfGen.AddDefaultText(LanguageContentBL.Translate("Pdf_Lu_Et_Approuve"), 145, 145, 20, 40);
                pdfGen.AddDefaultText(LanguageContentBL.Translate("Pdf_Date"), 160, 145, 20, 40);
            }

            pdfGen.AddDefaultBoldText(LanguageContentBL.Translate("Pdf_Signature_Client"), 100, 500, 20, 340);
            pdfGen.AddBlueBorder(130, 280, 200, 170);

            //Ne pas afficher si signature electronique
            if (forceDownload)
            {
                pdfGen.AddDefaultText(LanguageContentBL.Translate("Pdf_Lu_Et_Accepte"), 135, 200, 20, 285);
                pdfGen.AddDefaultText(LanguageContentBL.Translate("Pdf_Lu_Et_Approuve"), 145, 145, 20, 285);
                pdfGen.AddDefaultText(LanguageContentBL.Translate("Pdf_Date"), 160, 145, 20, 285);
            }

            #endregion

            //Force download if pathFileName is not set
            if (forceDownload)
            {
                string fileName = string.Format("LettreMission_PM_{0}.pdf", pMissionDoc.idMissionDocument);
                pdfGen.GeneratePdfToWeb(fileName);
            }
            else
            {
                pdfGen.GeneratePdf(pathFileName);
            }
            return pdfGen.PageCount;
        }