public static string generateOutputFile(enumOutputType outputType,string strTemplate, StyleSheet Style,int SwitchID,enumSwitchType SwitchType) { try { clsClient client = new clsClient(HttpContext.Current.Session["requestclientid"].ToString()); switch (outputType) { case enumOutputType.PDF: string Path = HttpContext.Current.Server.MapPath("~/Output/PDF/"); string PDFPath = string.Format("{0}{1}_{2}_{3}_{4:yyyy-MM-dd}.pdf", Path, SwitchType.ToString(), (new clsIFA(int.Parse(HttpContext.Current.Session["ifaid"].ToString()))).propIFA_Name, client.propForename +" "+ client.propSurname, DateTime.Now); using (clsPDF O = new clsPDF(){StyleSheet = Style}) { O.PageSetup(PageSize.LETTER, 40, 40, 30, 15); O.FromHTMLString(strTemplate); O.StartCreate(PDFPath); LogOutput(enumSwitchType.Portfolio,SwitchID,PDFPath,enumOutputType.PDF); } return PDFPath; default: return ""; } } catch (System.Net.Mail.SmtpException SE) { throw new clsOutputException(SE.Message, SE); } catch (Exception ex) { throw new clsOutputException(ex.Message, ex); } }
public static string generateApprovedSwitch(clsSwitch Switch, int IFAID) { string resultingRow = string.Empty; foreach (clsSwitchDetails SwitchDetails in Switch.propSwitchDetails) { clsFund Fund = new clsFund(SwitchDetails.propFundID); string myRow = ROWDETAILS.Replace("{^row$}", clsOutput.CELLDETAILS); myRow = myRow.Replace("{^FundCompany$}", new clsCompany(Fund.propFundManager).propCompany); myRow = myRow.Replace("{^FundName$}", Fund.propFundName); myRow = myRow.Replace("{^InsurComp$}", Fund.propCompanyID.ToString()); myRow = myRow.Replace("{^SEDOL$}", Fund.propSEDOL); myRow = myRow.Replace("{^%Portfolio$}", SwitchDetails.propAllocation + "%"); resultingRow += myRow; } clsClient client = new clsClient(Switch.propClientID); string html = clsOutput.PortfolioOutput_GetHTML(); clsIFA IFA = new clsIFA(IFAID); html = html.Replace("{^IFAName$}", IFA.propIFA_Name ?? string.Empty); html = html.Replace("{^ClientName$}", (client.propForename ?? String.Empty) + " " + (client.propSurname ?? string.Empty)); html = html.Replace("{^Company$}", Switch.propPortfolio.propCompany); html = html.Replace("{^PType$}", Switch.propPortfolio.propPortfolioType); html = html.Replace("{^DateTransmit$}", "???"); // DateTime.Now.ToString("MM-dd-yyyy")); //-->Temporary html = html.Replace("{^Curr$}", Switch.propPortfolio.propPortfolioCurrency); html = html.Replace("{^AccNum$}", Switch.propPortfolio.propAccountNumber); html = html.Replace("{^DateApprv$}", DateTime.Now.ToString("MM-dd-yyyy") ?? String.Empty);// Portfolio.propSwitch.propDate_Created.ToString("MM-dd-yyyy") ?? string.Empty); if (Switch.propPortfolio.propConfirmationRequired) { html = html.Replace("{^Sign$}", clsOutput.SIGNATURE) .Replace("{^SignatureClientName$}", client.propForename + " " + client.propSurname); } else { html = html.Replace("{^Sign$}", string.Empty); } html = html.Replace("{^SwitchDetails$}", resultingRow); return(html); }
public static string generateOutputFile(enumOutputType outputType, string strTemplate, StyleSheet Style, int SwitchID, enumSwitchType SwitchType) { try { clsClient client = new clsClient(HttpContext.Current.Session["requestclientid"].ToString()); switch (outputType) { case enumOutputType.PDF: string Path = HttpContext.Current.Server.MapPath("~/Output/PDF/"); string PDFPath = string.Format("{0}{1}_{2}_{3}_{4:yyyy-MM-dd}.pdf", Path, SwitchType.ToString(), (new clsIFA(int.Parse(HttpContext.Current.Session["ifaid"].ToString()))).propIFA_Name, client.propForename + " " + client.propSurname, DateTime.Now); using (clsPDF O = new clsPDF() { StyleSheet = Style }) { O.PageSetup(PageSize.LETTER, 40, 40, 30, 15); O.FromHTMLString(strTemplate); O.StartCreate(PDFPath); LogOutput(enumSwitchType.Portfolio, SwitchID, PDFPath, enumOutputType.PDF); } return(PDFPath); default: return(""); } } catch (System.Net.Mail.SmtpException SE) { throw new clsOutputException(SE.Message, SE); } catch (Exception ex) { throw new clsOutputException(ex.Message, ex); } }
public static string generateApprovedSwitchScheme(clsScheme Scheme) { string HoldingsRows = string.Empty; clsSwitchScheme switchScheme = new clsSwitchScheme(Scheme); foreach(clsSwitchScheme.clsSwitchSchemeDetails details in switchScheme.propSwitchDetails) { string myRow = clsOutput.ROWDETAILS.Replace("{^row$}", clsOutput.CELLDETAILS); myRow = myRow.Replace("{^FundCompany$}", details.propFund.propCompanyID.ToString() /* (new clsFund(details.propFund.propFundID)).propCompanyID.ToString()*/); myRow = myRow.Replace("{^FundName$}", details.propFund.propFundName); myRow = myRow.Replace("{^InsurComp$}", "None"); myRow = myRow.Replace("{^SEDOL$}", details.propFund.propSEDOL); myRow = myRow.Replace("{^%Portfolio$}", details.propAllocation.ToString("N2") + "%"); HoldingsRows += myRow; } string Contribution = string.Empty; foreach(clsSwitchScheme.clsSwitchSchemeDetails details in switchScheme.propSwitchDetailsContribution) { string myRow = clsOutput.ROWDETAILS.Replace("{^row$}", clsOutput.CELLDETAILS); myRow = myRow.Replace("{^FundCompany$}", details.propFund.propCompanyID.ToString() /* (new clsFund(details.propFund.propFundID)).propCompanyID.ToString()*/); myRow = myRow.Replace("{^FundName$}", details.propFund.propFundName); myRow = myRow.Replace("{^InsurComp$}", "None"); myRow = myRow.Replace("{^SEDOL$}", details.propFund.propSEDOL); myRow = myRow.Replace("{^%Portfolio$}", details.propAllocation.ToString("N2") + "%"); Contribution += myRow; } string html = SchemeOutput_GetHTML(); html = html.Replace("{^PortfolioHoldings$}", HoldingsRows); html = html.Replace("{^Contribution$}", Contribution); clsClient client = new clsClient(Scheme.propClient.propClientID); clsIFA IFA = new clsIFA(int.Parse(HttpContext.Current.Session["ifaid"].ToString())); html = html.Replace("{^IFAName$}", IFA.propIFA_Name); html = html.Replace("{^ClientName$}", client.propForename + " " + client.propSurname); html = html.Replace("{^Company$}", Scheme.propCompany.propCompany); html = html.Replace("{^PType$}", Scheme.propPortfolioType); html = html.Replace("{^DateTransmit$}", "?"); //-->Temporary html = html.Replace("{^Curr$}", Scheme.propSchemeCurrency); html = html.Replace("{^AccNum$}", Scheme.propAccountNumber); html = html.Replace("{^DateApprv$}", DateTime.Now.ToString("MM-dd-yyyy") ?? String.Empty); if (Scheme.propConfirmationRequired) { html = html.Replace("{^Sign$}", clsOutput.SIGNATURE); html = html.Replace("{^SignatureClientName$}", client.propForename + " " + client.propSurname); } else { html = html.Replace("{^Sign$}", string.Empty); } return html; }
public static string generateApprovedSwitch(clsSwitch Switch, int IFAID) { string resultingRow = string.Empty; foreach (clsSwitchDetails SwitchDetails in Switch.propSwitchDetails) { clsFund Fund = new clsFund(SwitchDetails.propFundID); string myRow = ROWDETAILS.Replace("{^row$}", clsOutput.CELLDETAILS); myRow = myRow.Replace("{^FundCompany$}", new clsCompany(Fund.propFundManager).propCompany); myRow = myRow.Replace("{^FundName$}", Fund.propFundName); myRow = myRow.Replace("{^InsurComp$}", Fund.propCompanyID.ToString()); myRow = myRow.Replace("{^SEDOL$}", Fund.propSEDOL); myRow = myRow.Replace("{^%Portfolio$}", SwitchDetails.propAllocation + "%"); resultingRow += myRow; } clsClient client = new clsClient(Switch.propClientID); string html = clsOutput.PortfolioOutput_GetHTML(); clsIFA IFA = new clsIFA(IFAID); html = html.Replace("{^IFAName$}", IFA.propIFA_Name ?? string.Empty); html = html.Replace("{^ClientName$}",(client.propForename ?? String.Empty) + " " + (client.propSurname ?? string.Empty) ); html = html.Replace("{^Company$}", Switch.propPortfolio.propCompany); html = html.Replace("{^PType$}", Switch.propPortfolio.propPortfolioType); html = html.Replace("{^DateTransmit$}", "???"); // DateTime.Now.ToString("MM-dd-yyyy")); //-->Temporary html = html.Replace("{^Curr$}", Switch.propPortfolio.propPortfolioCurrency); html = html.Replace("{^AccNum$}", Switch.propPortfolio.propAccountNumber); html = html.Replace("{^DateApprv$}", DateTime.Now.ToString("MM-dd-yyyy") ?? String.Empty);// Portfolio.propSwitch.propDate_Created.ToString("MM-dd-yyyy") ?? string.Empty); if (Switch.propPortfolio.propConfirmationRequired) { html = html.Replace("{^Sign$}", clsOutput.SIGNATURE) .Replace("{^SignatureClientName$}", client.propForename + " " + client.propSurname ); } else { html = html.Replace("{^Sign$}", string.Empty); } html = html.Replace("{^SwitchDetails$}", resultingRow); return html; }