private ApplicationDocumentsModel CreateRecordOfAdvie(RecordOfAdviseModel roa, string firstname, string lastname, string idnumber, UserModel advisor, RiskProfileModel risk, AdvisorAdviseModel advise) { var data = new Dictionary <string, string>(); var date = DateTime.Today.ToShortDateString(); var nameSurname = $"{firstname} {lastname}"; data["BdaNumber"] = string.Empty; data["Date_A"] = date; data["NameSurname_A"] = nameSurname; data["IdNo"] = idnumber; data["AdvisorName"] = $"{advisor.FirstName} {advisor.LastName}"; data["AdvisorEmail"] = advisor.Email; data["AdvisorMobile"] = advisor.MobileNumber; var advDetails = advisor.BrokerDetails; data["AdviserAddress"] = $"{advDetails.UnitNo} {advDetails.Complex} " + $"{advDetails.StreetNo} {advDetails.StreetName} {advDetails.Suburb} " + $"{advDetails.City}, {advDetails.PostalCode}"; data["Introduction"] = roa.Introduction; var prodProperties = new List <string>() { "ProductName", "RecommendedLumpSum", "AcceptedLumpSum", "RecommendedRecurringPremium", "AcceptedRecurringPremium", "DeveationReason" }; foreach (var product in roa.SelectedProducts) { data[$"{product.ProductName}_ProductName"] = product.ProductName; data[$"{product.ProductName}_RecommendedLumpSum"] = product.RecommendedLumpSum > 0 ? product.RecommendedLumpSum.ToString() : string.Empty; data[$"{product.ProductName}_AcceptedLumpSum"] = product.AcceptedLumpSum > 0 ? product.AcceptedLumpSum.ToString() : string.Empty; data[$"{product.ProductName}_RecommendedRecurringPremium"] = product.RecommendedRecurringPremium > 0 ? product.RecommendedRecurringPremium.ToString() : string.Empty;; data[$"{product.ProductName}_AcceptedRecurringPremium"] = product.AcceptedRecurringPremium > 0 ? product.AcceptedRecurringPremium.ToString() : string.Empty;; data[$"{product.ProductName}_DeveationReason"] = product.DeveationReason ?? string.Empty;; } return(new ApplicationDocumentsModel() { DocuemtnData = PopulateDocument("ROA.pdf", data), DocumentType = DocumentTypesEnum.RecordOfAdvise }); }
private ApplicationDocumentsModel CreateFinancialNeedsAnalysis(RecordOfAdviseModel roa, string city, string firstName, string lastname, string idNumber, UserModel advisor) { var data = new Dictionary <string, string>(); int c = 1; foreach (var prod in roa.SelectedProducts) { if (prod.DeveationReason == null) { data[$"prod{c}"] = prod.RecommendedLumpSum > 0 ? $"{prod.ProductName}: R {prod.RecommendedLumpSum}, R {prod.RecommendedRecurringPremium}" : $"{prod.ProductName}: R {prod.RecommendedLumpSum}"; } else { data[$"prod{c}"] = prod.AcceptedRecurringPremium > 0 ? $"{prod.ProductName}: R {prod.AcceptedLumpSum}, R {prod.AcceptedRecurringPremium}" : $"{prod.ProductName}: R {prod.AcceptedLumpSum}"; } } data["reason"] = $"After discussions with the client, and according to the risk profile " + $"the above investment/s were decided and agreed on."; data["signedAt"] = city; data["day"] = DateTime.Today.Day.ToString(); data["monthYear"] = $"{DateTime.Today.Month}-{DateTime.Today.Year}"; data["client"] = $"{firstName} {lastname} {idNumber}"; data["advisor"] = $"{advisor.FirstName} {advisor.LastName} {advisor.IdNumber}"; return(new ApplicationDocumentsModel() { DocuemtnData = PopulateDocument("FNA.pdf", data), DocumentType = DocumentTypesEnum.FinancialNeedsAnalysis }); }
private ApplicationDocumentsModel CreateFspMandate(string firstname, string lastname, RiskProfileModel risk, FspMandateModel man, AddressDto address, UserModel client, UserModel adviser, RecordOfAdviseModel roa, BankVerificationsModel bv) { var d = new Dictionary <string, string>(); var clientDetails = $"{firstname} {lastname}"; var Advisor = $"{adviser.FirstName} {adviser.LastName}"; d["ClientDetails_a"] = clientDetails; var p2 = string.Empty; foreach (var p in roa.SelectedProducts) { p2 += p.ProductName; } d["Products"] = p2; d["Bank"] = bv.BankName; d["Branch"] = bv.BranchCode; d["AccNo"] = bv.AccountNumber; d["StartDate"] = DateTime.Now.ToShortDateString(); d["Address_1"] = $"{address.UnitNumber} {address.Complex}"; d["Address_2"] = $"{address.StreetNumber} {address.StreetName}," + $"{address.Suburb} {address.PostalCode}"; d["Address_3"] = $"{address.City} {address.Country}"; d["Email"] = client.Email; d["FspSignatory"] = Advisor; d["ClientDetails_b"] = clientDetails; // location d["dateFsp"] = DateTime.Now.ToShortDateString(); d["dateClient"] = DateTime.Now.ToShortDateString(); d["atFsp"] = adviser.BrokerDetails.City; d["atClient"] = address.City; // full / limited discretion d[man.Objective] = "x"; d[$"{man.Objective[0]}{risk.DerivedProfile}"] = "x"; d["instruction_personal"] = man.InstructionPersonal ?? string.Empty; d["instruction_advisor"] = man.InstructionAdvisor ?? string.Empty; d["Adviser"] = man.Advisor ?? string.Empty; d["instruction_fsp"] = man.InstructionFsp ?? string.Empty; d[man.PayoutOption] = "x"; // client details d d[$"{man.Objective[0]}ClientDetails"] = clientDetails; d[$"{man.Objective[0]}At"] = address.City; d[$"{man.Objective[0]}Date"] = DateTime.Now.ToShortDateString(); var na = man.Objective[0].ToString() == "L" ? "LNA" : "FNA"; d[na] = "N/A"; return(new ApplicationDocumentsModel() { DocuemtnData = PopulateDocument("FspMandate.pdf", d), DocumentType = DocumentTypesEnum.FspMandate }); }