private void populateProposedSwitch(List <clsSwitchDetails> listProposedSwitch) { this.gvSwitchDetails_IFA.DataSource = listProposedSwitch; this.gvSwitchDetails_IFA.DataBind(); if (listProposedSwitch.Count != 0) { Label gvSwitchFooterLblTotalValue = (Label)this.gvSwitchDetails_IFA.FooterRow.Cells[3].FindControl("gvSwitchFooterLblTotalValue"); gvSwitchFooterLblTotalValue.Text = listProposedSwitch[0].propTotalValue.ToString("n0"); Label gvSwitchFooterLblTotalAllocation = (Label)this.gvSwitchDetails_IFA.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocation.Text = listProposedSwitch[listProposedSwitch.Count - 1].propTotalAllocation.ToString("n2"); this.lblSwitchDetails_IFAStatusValue.Text = new clsSwitch(listProposedSwitch[0].propSwitchID).propStatusString; this.txtProposedSwitchDesc.Text = new clsSwitch(listProposedSwitch[0].propSwitchID).propDescription.ToString(); int intStatus = new clsSwitch(listProposedSwitch[0].propSwitchID).propStatus; if ((intStatus == (int)clsSwitch.enumSwitchStatus.Approved) || (intStatus == (int)clsSwitch.enumSwitchStatus.Locked)) { this.btnApproveSwitch.Disabled = true; this.btnAmendSwitch.Enabled = false; this.btnDeclineSwitch.Enabled = false; this.btnContactMe.Enabled = false; } } else { this.btnApproveSwitch.Disabled = true; this.btnAmendSwitch.Enabled = false; this.btnDeclineSwitch.Enabled = false; this.btnContactMe.Enabled = false; } }
protected void NotifyApprovedSwtich(clsSwitch Switch) { int intIFAID = int.Parse(Session["ifaid"].ToString()); clsIFA IFA = new clsIFA(intIFAID); string htmlTemplate = clsOutput.generateApprovedSwitch(Switch, IFA.propIFA_ID); StyleSheet style = clsOutput.getStyleSheet_ApprovedSwitch(); string strFilename = clsOutput.generateOutputFile(clsOutput.enumOutputType.PDF, htmlTemplate, style, Switch.propSwitchID, clsOutput.enumSwitchType.Portfolio); string strRecepient = IFA.propIFAEmail; string strSender = "*****@*****.**"; string strSubject = "Switch Instruction"; string strBody = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyApprovedEmailReqSign" : "NotifyApprovedEmail"), null, null, null, null, null, Switch.propPortfolio.propCompany, Switch.propSwitchID.ToString()); clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename); clsClient client = new clsClient(Switch.propClientID); string ClientName = client.propForename + " " + client.propSurname; if (!String.IsNullOrEmpty(client.propEmailWork)) { strRecepient = client.propEmailWork; strBody = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Switch.propPortfolio.propCompany, null); clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename); } if (!String.IsNullOrEmpty(client.propEmailPersonal)) { strRecepient = client.propEmailPersonal; strBody = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Switch.propPortfolio.propCompany, null); clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename); } }
private void saveSwitchHistory(clsPortfolio _clsPortfolio, int intSwitchID, string strPortfolioID, string strUserID, clsSwitch.enumSwitchStatus enumSwitchStatus, string strDescription) { clsSwitch oSwitch = new clsSwitch(_clsPortfolio, strUserID); int intHistoryID = clsHistory.insertHeader(strPortfolioID, intSwitchID, Convert.ToInt16(enumSwitchStatus)); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, strDescription); }
private void populateAmendSwitch(List <clsSwitchDetails_Client> listAmendSwitch) { this.gvAmendSwitch.DataSource = listAmendSwitch; this.gvAmendSwitch.DataBind(); if (listAmendSwitch != null) { this.lblSwitchStatusValue.Text = new clsSwitch_Client(listAmendSwitch[0].propSwitchID).propStatusString; int intStatus = new clsSwitch(listAmendSwitch[0].propSwitchID).propStatus; Label gvSwitchFooterLblTotalValue = (Label)this.gvAmendSwitch.FooterRow.Cells[3].FindControl("gvSwitchFooterLblTotalValue"); gvSwitchFooterLblTotalValue.Text = listAmendSwitch[0].propTotalValue.ToString("n0"); Label gvSwitchFooterLblTotalAllocationOrig = (Label)this.gvAmendSwitch.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocationOrig"); gvSwitchFooterLblTotalAllocationOrig.Text = listAmendSwitch[listAmendSwitch.Count - 1].propTotalAllocation.ToString("n2"); Label gvSwitchFooterLblTotalAllocation = (Label)this.gvAmendSwitch.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocation.Text = listAmendSwitch[listAmendSwitch.Count - 1].propTotalAllocation.ToString("n2"); gvSwitchFooterHfTotalAllocation.Value = listAmendSwitch[listAmendSwitch.Count - 1].propTotalAllocation.ToString("n2"); this.hfCurrentValueClientTotal.Value = listAmendSwitch[0].propTotalValue.ToString("n0"); this.hfFundCount.Value = listAmendSwitch.Count.ToString(); if (float.Parse(gvSwitchFooterLblTotalAllocationOrig.Text) != 100) { gvSwitchFooterLblTotalAllocation.Style.Add("color", "#FF0000"); gvSwitchFooterLblTotalAllocationOrig.Style.Add("color", "#FF0000"); } else { gvSwitchFooterLblTotalAllocation.Style.Add("color", "#000000"); gvSwitchFooterLblTotalAllocationOrig.Style.Add("color", "#000000"); } } //if (new clsSwitch(listAmendSwitch[0].propSwitchID).propStatusString == clsSwitch.enumSwitchStatus.Saved.ToString()) //{ // this.btnSave.Disabled = true; //} //else //{ // this.btnSave.Disabled = false; //} //if (intStatus == (int)clsSwitch.enumSwitchStatus.Proposed) //{ // btnSave.Disabled = true; // btnSwitch.Disabled = true; //} //else if (intStatus == (int)clsSwitch.enumSwitchStatus.Approved) //{ // btnSave.Disabled = true; // btnSwitch.Disabled = true; // btnCancel.Enabled = false; //} }
protected void btnCancel_Click(object sender, EventArgs e) { List <clsSwitchDetails> ListSwitchDetails = (List <clsSwitchDetails>)Session["SwitchDetails"]; clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); if ((oSwitch.propStatus != (int)clsSwitch.enumSwitchStatus.Draft) && (oSwitch.propStatus != (int)clsSwitch.enumSwitchStatus.Saved)) { int intHistoryID = clsHistory.insertHeader(PortfolioID(), oSwitch.propSwitchID, (Int16)clsSwitch.enumSwitchStatus.Cancelled); } clsSwitch.deleteSwitch(ListSwitchDetails[0].propSwitchID); string backPageURL = "https://" + Request.ServerVariables["SERVER_NAME"] + ":" + Request.ServerVariables["SERVER_PORT"] + "/report/" + "portfoliodetails.asp"; ClientScript.RegisterStartupScript(this.GetType(), "alertCancelledSwitch", "alert('This Switch has been cancelled'); window.location='" + backPageURL + "';", true); }
private void btnSave_Click() { captureSwitchGridviewDetails(); List <clsSwitchDetails> ListSwitchDetails = (List <clsSwitchDetails>)Session["SwitchDetails"]; saveSwitch(clsSwitch.enumSwitchStatus.Saved, ListSwitchDetails[0].propSwitchID, string.Empty); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); populateSwitchDetails(oSwitch.propSwitchDetails); string backPageURL = "https://" + Request.ServerVariables["SERVER_NAME"] + ":" + Request.ServerVariables["SERVER_PORT"] + "/report/" + "portfoliodetails.asp"; ClientScript.RegisterStartupScript(this.GetType(), "alertSaveSuccess", "alert('This Switch has been saved.'); window.location='" + backPageURL + "';", true); }
private void populateSwitchDetails(List <clsSwitchDetails> listSwitchDetails) { this.gvSwitchDetails.DataSource = listSwitchDetails; this.gvSwitchDetails.DataBind(); if (listSwitchDetails.Count > 0) { this.lblSwitchStatusValue.Text = new clsSwitch(listSwitchDetails[0].propSwitchID).propStatusString; int intStatus = new clsSwitch(listSwitchDetails[0].propSwitchID).propStatus; Label gvSwitchFooterLblTotalValue = (Label)this.gvSwitchDetails.FooterRow.Cells[3].FindControl("gvSwitchFooterLblTotalValue"); gvSwitchFooterLblTotalValue.Text = listSwitchDetails[0].propTotalValue.ToString("n0"); Label gvSwitchFooterLblTotalAllocationOrig = (Label)this.gvSwitchDetails.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocationOrig"); gvSwitchFooterLblTotalAllocationOrig.Text = listSwitchDetails[listSwitchDetails.Count - 1].propTotalAllocation.ToString("n2"); Label gvSwitchFooterLblTotalAllocation = (Label)this.gvSwitchDetails.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocation.Text = listSwitchDetails[listSwitchDetails.Count - 1].propTotalAllocation.ToString("n2"); gvSwitchFooterHfTotalAllocation.Value = listSwitchDetails[listSwitchDetails.Count - 1].propTotalAllocation.ToString("n2"); this.hfCurrentValueClientTotal.Value = listSwitchDetails[0].propTotalValue.ToString("n0"); this.hfFundCount.Value = listSwitchDetails.Count.ToString(); if (float.Parse(gvSwitchFooterLblTotalAllocationOrig.Text) != 100) { gvSwitchFooterLblTotalAllocation.Style.Add("color", "#FF0000"); gvSwitchFooterLblTotalAllocationOrig.Style.Add("color", "#FF0000"); } else { gvSwitchFooterLblTotalAllocation.Style.Add("color", "#000000"); gvSwitchFooterLblTotalAllocationOrig.Style.Add("color", "#000000"); } if (new clsSwitch(listSwitchDetails[0].propSwitchID).propStatusString == clsSwitch.enumSwitchStatus.Saved.ToString()) { this.btnSave.Disabled = true; } else { this.btnSave.Disabled = false; } Session["SwitchDetails"] = listSwitchDetails; } }
private void saveSwitch(clsSwitch.enumSwitchStatus SwitchStatus, Nullable<int> intSwitchID, string strDescription) { List<clsSwitchDetails> newListSwitchDetails = (List<clsSwitchDetails>)Session["SwitchDetails"]; int intNewSwitchID = clsSwitch.insertSwitchHeader(PortfolioID(), ClientID(), UserID(), SwitchStatus, intSwitchID, strDescription); clsSwitchDetails.insertSwitchDetails(newListSwitchDetails, UserID(), intNewSwitchID); }
private void saveSwitch(clsSwitch.enumSwitchStatus SwitchStatus, Nullable<int> intSwitchID, string strDescription, string strUserID, clsScheme Scheme) { List<clsSwitchScheme.clsSwitchSchemeDetails> newListSwitchDetails = (List<clsSwitchScheme.clsSwitchSchemeDetails>)Session["listSwitchDetails"]; List<clsSwitchScheme.clsSwitchSchemeDetails> newListSwitchDetailsContribution = (List<clsSwitchScheme.clsSwitchSchemeDetails>)Session["listSwitchContributionDetails"]; clsSwitchScheme.clsSwitchSchemeDetails.deleteAllDetails(intSwitchID); int intNewSwitchID = clsSwitchScheme.insertSwitchHeader(Scheme, strUserID, SwitchStatus, intSwitchID, strDescription); clsSwitchScheme.clsSwitchSchemeDetails.insertSwitchDetails(newListSwitchDetails, strUserID, intNewSwitchID, false); clsSwitchScheme.clsSwitchSchemeDetails.insertSwitchDetails(newListSwitchDetailsContribution, strUserID, intNewSwitchID, true); }
private void saveclientSwitch(clsSwitch.enumSwitchStatus SwitchStatus, int intSwitchID, string strDesc) { strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); strPortfolioID = Session[clsSystem_Session.strSession.tempportfolioid.ToString()].ToString(); List<clsSwitchDetails_Client> newListSwitchDetails = (List<clsSwitchDetails_Client>)Session["SwitchDetails_Client"]; clsSwitch_Client.updateSwitchHeader(SwitchStatus, intSwitchID, strDesc); clsSwitchDetails_Client.insertSwitchDetails(newListSwitchDetails, strUserID, intSwitchID); }
private void enableButtons(clsSwitch.enumSwitchStatus SwitchStatus) { switch (SwitchStatus) { case clsSwitch.enumSwitchStatus.Proposed: this.btnApproveSwitch.Disabled = false; this.btnAmendSwitch.Enabled = true; this.btnDeclineSwitch.Enabled = true; this.btnContactMe.Enabled = true; break; case clsSwitch.enumSwitchStatus.Request_ForDiscussion: this.btnApproveSwitch.Disabled = true; this.btnAmendSwitch.Enabled = false; this.btnDeclineSwitch.Enabled = false; this.btnContactMe.Enabled = false; break; default: this.btnApproveSwitch.Disabled = true; this.btnAmendSwitch.Enabled = false; this.btnDeclineSwitch.Enabled = false; this.btnContactMe.Enabled = false; break; } }
private void populateAmendSwitch(List<clsSwitchDetails_Client> listAmendSwitch) { this.gvAmendSwitch.DataSource = listAmendSwitch; this.gvAmendSwitch.DataBind(); if (listAmendSwitch != null) { this.lblSwitchStatusValue.Text = new clsSwitch_Client(listAmendSwitch[0].propSwitchID).propStatusString; int intStatus = new clsSwitch(listAmendSwitch[0].propSwitchID).propStatus; Label gvSwitchFooterLblTotalValue = (Label)this.gvAmendSwitch.FooterRow.Cells[3].FindControl("gvSwitchFooterLblTotalValue"); gvSwitchFooterLblTotalValue.Text = listAmendSwitch[0].propTotalValue.ToString("n0"); Label gvSwitchFooterLblTotalAllocationOrig = (Label)this.gvAmendSwitch.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocationOrig"); gvSwitchFooterLblTotalAllocationOrig.Text = listAmendSwitch[listAmendSwitch.Count - 1].propTotalAllocation.ToString("n2"); Label gvSwitchFooterLblTotalAllocation = (Label)this.gvAmendSwitch.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocation.Text = listAmendSwitch[listAmendSwitch.Count - 1].propTotalAllocation.ToString("n2"); gvSwitchFooterHfTotalAllocation.Value = listAmendSwitch[listAmendSwitch.Count - 1].propTotalAllocation.ToString("n2"); this.hfCurrentValueClientTotal.Value = listAmendSwitch[0].propTotalValue.ToString("n0"); this.hfFundCount.Value = listAmendSwitch.Count.ToString(); if (float.Parse(gvSwitchFooterLblTotalAllocationOrig.Text) != 100) { gvSwitchFooterLblTotalAllocation.Style.Add("color", "#FF0000"); gvSwitchFooterLblTotalAllocationOrig.Style.Add("color", "#FF0000"); } else { gvSwitchFooterLblTotalAllocation.Style.Add("color", "#000000"); gvSwitchFooterLblTotalAllocationOrig.Style.Add("color", "#000000"); } } //if (new clsSwitch(listAmendSwitch[0].propSwitchID).propStatusString == clsSwitch.enumSwitchStatus.Saved.ToString()) //{ // this.btnSave.Disabled = true; //} //else //{ // this.btnSave.Disabled = false; //} //if (intStatus == (int)clsSwitch.enumSwitchStatus.Proposed) //{ // btnSave.Disabled = true; // btnSwitch.Disabled = true; //} //else if (intStatus == (int)clsSwitch.enumSwitchStatus.Approved) //{ // btnSave.Disabled = true; // btnSwitch.Disabled = true; // btnCancel.Enabled = false; //} }
private void populateProposedSwitch(List<clsSwitchDetails> listProposedSwitch) { this.gvSwitchDetails_IFA.DataSource = listProposedSwitch; this.gvSwitchDetails_IFA.DataBind(); Label gvSwitchFooterLblTotalValue = (Label)this.gvSwitchDetails_IFA.FooterRow.Cells[3].FindControl("gvSwitchFooterLblTotalValue"); gvSwitchFooterLblTotalValue.Text = listProposedSwitch[0].propTotalValue.ToString("n0"); Label gvSwitchFooterLblTotalAllocation = (Label)this.gvSwitchDetails_IFA.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocation.Text = listProposedSwitch[listProposedSwitch.Count - 1].propTotalAllocation.ToString("n2"); this.lblSwitchDetails_IFAStatusValue.Text = new clsSwitch(listProposedSwitch[0].propSwitchID).propStatusString; this.txtProposedSwitchDesc.Text = new clsSwitch(listProposedSwitch[0].propSwitchID).propDescription.ToString(); int intStatus = new clsSwitch(listProposedSwitch[0].propSwitchID).propStatus; if ((intStatus == (int)clsSwitch.enumSwitchStatus.Approved) || (intStatus == (int)clsSwitch.enumSwitchStatus.Locked)) { this.btnApproveSwitch.Disabled = true; this.btnAmendSwitch.Enabled = false; this.btnDeclineSwitch.Enabled = false; this.btnContactMe.Enabled = false; } }
private void saveclientSwitch(clsSwitch.enumSwitchStatus SwitchStatus, int intSwitchID, string strDesc) { String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); clsSwitchScheme_Client.clsSwitchSchemeDetails_Client.deleteAllDetails(intSwitchID); List<clsSwitchScheme_Client.clsSwitchSchemeDetails_Client> ListSwitchDetails = (List<clsSwitchScheme_Client.clsSwitchSchemeDetails_Client>)Session["SwitchSchemeDetailsPortfolio_Client"]; List<clsSwitchScheme_Client.clsSwitchSchemeDetails_Client> ListSwitchDetailsContribution = (List<clsSwitchScheme_Client.clsSwitchSchemeDetails_Client>)Session["SwitchSchemeDetailsContribution_Client"]; clsSwitchScheme_Client.updateSwitchHeader(SwitchStatus, intSwitchID, strDesc); clsSwitchScheme_Client.clsSwitchSchemeDetails_Client.insertSwitchDetails(ListSwitchDetails, strUserID, propSwitchID, false); clsSwitchScheme_Client.clsSwitchSchemeDetails_Client.insertSwitchDetails(ListSwitchDetailsContribution, strUserID, propSwitchID, true); }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { if (Request["__EVENTARGUMENT"] == "SaveSwitchDetails") { btnSave_Click(); } else if (Request["__EVENTARGUMENT"] == "ChangeFund") { replaceFund(int.Parse(this.hfFundIDOrig.Value), int.Parse(this.hfFundIDNew.Value)); } else if (Request["__EVENTARGUMENT"] == "AddMoreFund") { addNewFund(int.Parse(this.hfFundIDNew.Value)); } } else { Session["SourcePage"] = "/report/portfoliodetails.asp"; string strSurname = Session[clsSystem_Session.strSession.surname.ToString()].ToString(); string strForename = Session[clsSystem_Session.strSession.Forenames.ToString()].ToString(); string strCode = Session[clsSystem_Session.strSession.code.ToString()].ToString(); if (Session[clsSystem_Session.strSession.showname.ToString()].ToString() == "yes") { if (Session[clsSystem_Session.strSession.surname.ToString()] == null) { strPortfolioName = "Portfolio Details"; } else { if (Session[clsSystem_Session.strSession.lang.ToString()].ToString() == "2") { strPortfolioName = string.Format("{0} {1}({2})", strSurname, strForename, strCode); } else { strPortfolioName = string.Format("{1} {0}({2})", strSurname, strForename, strCode); } } } else { strPortfolioName = Session[clsSystem_Session.strSession.code.ToString()].ToString(); } setSessionCodepage(); populateHeader(Portfolio(), strPortfolioName); this.populateDetails(Portfolio().propPortfolioDetails); if (Portfolio().propSwitch.propStatus == (int)clsSwitch.enumSwitchStatus.Amended) { clsSwitch_Client oClientSwitch = new clsSwitch_Client(Portfolio().propSwitch.propSwitchID); populateSwitchDetailsClient(oClientSwitch); } if (Portfolio().propPortfolioDetails.Count > 0) { clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); populateSwitchDetails(oSwitch.propSwitchDetails); pageStatus(Portfolio().propSwitch.propStatus); } } }
private void populateSwitchDetails(List<clsSwitchDetails> listSwitchDetails) { this.gvSwitchDetails.DataSource = listSwitchDetails; this.gvSwitchDetails.DataBind(); this.lblSwitchStatusValue.Text = new clsSwitch(listSwitchDetails[0].propSwitchID).propStatusString; int intStatus = new clsSwitch(listSwitchDetails[0].propSwitchID).propStatus; Label gvSwitchFooterLblTotalValue = (Label)this.gvSwitchDetails.FooterRow.Cells[3].FindControl("gvSwitchFooterLblTotalValue"); gvSwitchFooterLblTotalValue.Text = listSwitchDetails[0].propTotalValue.ToString("n0"); Label gvSwitchFooterLblTotalAllocationOrig = (Label)this.gvSwitchDetails.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocationOrig"); gvSwitchFooterLblTotalAllocationOrig.Text = listSwitchDetails[listSwitchDetails.Count - 1].propTotalAllocation.ToString("n2"); Label gvSwitchFooterLblTotalAllocation = (Label)this.gvSwitchDetails.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocation.Text = listSwitchDetails[listSwitchDetails.Count - 1].propTotalAllocation.ToString("n2"); gvSwitchFooterHfTotalAllocation.Value = listSwitchDetails[listSwitchDetails.Count - 1].propTotalAllocation.ToString("n2"); this.hfCurrentValueClientTotal.Value = listSwitchDetails[0].propTotalValue.ToString("n0"); this.hfFundCount.Value = listSwitchDetails.Count.ToString(); if (float.Parse(gvSwitchFooterLblTotalAllocationOrig.Text) != 100) { gvSwitchFooterLblTotalAllocation.Style.Add("color", "#FF0000"); gvSwitchFooterLblTotalAllocationOrig.Style.Add("color", "#FF0000"); } else { gvSwitchFooterLblTotalAllocation.Style.Add("color", "#000000"); gvSwitchFooterLblTotalAllocationOrig.Style.Add("color", "#000000"); } if (new clsSwitch(listSwitchDetails[0].propSwitchID).propStatusString == clsSwitch.enumSwitchStatus.Saved.ToString()) { this.btnSave.Disabled = true; } else { this.btnSave.Disabled = false; } Session["SwitchDetails"] = listSwitchDetails; }
protected void btnCancel_Click(object sender, EventArgs e) { List<clsSwitchDetails> ListSwitchDetails = (List<clsSwitchDetails>)Session["SwitchDetails"]; clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); if ((oSwitch.propStatus != (int)clsSwitch.enumSwitchStatus.Draft) && (oSwitch.propStatus != (int)clsSwitch.enumSwitchStatus.Saved)) { int intHistoryID = clsHistory.insertHeader(PortfolioID(), oSwitch.propSwitchID, (Int16)clsSwitch.enumSwitchStatus.Cancelled); } clsSwitch.deleteSwitch(ListSwitchDetails[0].propSwitchID); string backPageURL = "https://" + Request.ServerVariables["SERVER_NAME"] + ":" + Request.ServerVariables["SERVER_PORT"] + "/report/" + "portfoliodetails.asp"; ClientScript.RegisterStartupScript(this.GetType(), "alertCancelledSwitch", "alert('This Switch has been cancelled'); window.location='" + backPageURL + "';", true); }
private void btnSave_Click() { captureSwitchGridviewDetails(); List<clsSwitchDetails> ListSwitchDetails = (List<clsSwitchDetails>)Session["SwitchDetails"]; saveSwitch(clsSwitch.enumSwitchStatus.Saved, ListSwitchDetails[0].propSwitchID, string.Empty); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); populateSwitchDetails(oSwitch.propSwitchDetails); string backPageURL = "https://" + Request.ServerVariables["SERVER_NAME"] + ":" + Request.ServerVariables["SERVER_PORT"] + "/report/" + "portfoliodetails.asp"; ClientScript.RegisterStartupScript(this.GetType(), "alertSaveSuccess", "alert('This Switch has been saved.'); window.location='" + backPageURL + "';", true); }
private int saveSwitch(string strClientID, string strPortfolioID, string strUserID, clsSwitch.enumSwitchStatus enumSwitchStatus, int intSwitchID, List<clsSwitchDetails> clsSwitchDetailsList, string strDescription,int intModelID, string strModelGroupID, string strModelPortfolioID) { int intNewSwitchID = clsSwitch.insertSwitchHeaderWithModel(strPortfolioID, strClientID, strUserID, enumSwitchStatus, intSwitchID, strDescription, intModelID, ModelID(), ModelPortfolioID()); clsSwitch.deleteSwitchDetails(intNewSwitchID); clsSwitchDetails.insertSwitchDetails(clsSwitchDetailsList, strUserID, intNewSwitchID); return intNewSwitchID; }
private int saveCustomizedSwitch(int intIFA_ID, string strClientID, string strPortfolioID, string strUserID, clsSwitch.enumSwitchStatus enumSwitchStatus, Nullable<int> intSwitchID, string strModelGroupID, string strModelPortfolioID) { int intNewSwitchID = clsSwitch.insertCustomizedSwitchHeaderWithModel(intIFA_ID, strClientID, strPortfolioID, strUserID, enumSwitchStatus, intSwitchID, strModelGroupID, strModelPortfolioID); clsSwitch.deleteSwitchDetails(intNewSwitchID); clsSwitchDetails.insertSwitchDetails(intNewSwitchID, strClientID, strPortfolioID); return intNewSwitchID; }
private void doSwitchSendSave(string strButtonClick) { captureSwitchGridviewDetails(); string strPortfolioName = Portfolio().propCompany; int intDiscretionary = int.Parse(Session["HasDiscretionary"].ToString()); clsSMS.subclsSMSTemplate osubclsSMSTemplate = new clsSMS.subclsSMSTemplate(clsSMS.subclsSMSTemplate.enumSMSTemplateID.ProposeSwitch); string strReplacerVariable = clsSMS.subclsSMSTemplate.strPortfolioNameVariable; string strMessage = osubclsSMSTemplate.propMessage.Replace(strReplacerVariable, strPortfolioName); string strPopupMessage = "Message sent."; string strSMSMobileNo = txtSMSMobileNo.Text.Trim(); if (strButtonClick == enumButton.Approve.ToString()) { List <clsSwitchDetails_Client> oSwitchDetailsClient = (List <clsSwitchDetails_Client>)Session["SwitchDetailsClient"]; int intSwitchID = oSwitchDetailsClient[0].propSwitchID; clsSwitchDetails.transferClientSwitchToIFA(oSwitchDetailsClient, UserID()); clsSwitch_Client.updateSwitchHeader(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, string.Empty); clsSwitch.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Proposed, txtDescription.Text); int intHistoryID = clsHistory.insertHeader(new clsSwitch(intSwitchID).propPortfolioID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text); if (strSMSMobileNo.Length != 0) { sendSMS(UserID(), strMessage, strPopupMessage, strSMSMobileNo); } string backPageURL = "https://" + Request.ServerVariables["SERVER_NAME"] + ":" + Request.ServerVariables["SERVER_PORT"] + "/report/" + "portfoliodetails.asp"; ClientScript.RegisterStartupScript(this.GetType(), "alertSaveSuccess", "alert('This Amended Switch has been approved.'); window.location='" + backPageURL + "';", true); } else if (strButtonClick == enumButton.Resubmit.ToString()) { int intSwitchID = Portfolio().propSwitch.propSwitchID; saveSwitch(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, txtDescription.Text); clsSwitch_Client.updateSwitchHeader(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, string.Empty); int intHistoryID = clsHistory.insertHeader(new clsSwitch(intSwitchID).propPortfolioID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text); if (strSMSMobileNo.Length != 0) { sendSMS(UserID(), strMessage, strPopupMessage, strSMSMobileNo); } } else { List <clsSwitchDetails> oSwitchDetails = (List <clsSwitchDetails>)Session["SwitchDetails"]; int intSwitchID = oSwitchDetails[0].propSwitchID; if (intSwitchID == 0) { if (intDiscretionary == 1 || intDiscretionary == -1) { saveSwitch(clsSwitch.enumSwitchStatus.Approved, null, txtDescription.Text.Trim()); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); int intHistoryID = clsHistory.insertHeader(PortfolioID(), intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Approved); NotifyApprovedSwtich(oSwitch); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text.Trim()); } else { saveSwitch(clsSwitch.enumSwitchStatus.Proposed, null, txtDescription.Text.Trim()); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); int intHistoryID = clsHistory.insertHeader(PortfolioID(), oSwitch.propSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text.Trim()); } } else { if (intDiscretionary == 1 || intDiscretionary == -1) { saveSwitch(clsSwitch.enumSwitchStatus.Approved, intSwitchID, txtDescription.Text.Trim()); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); int intHistoryID = clsHistory.insertHeader(PortfolioID(), intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Approved); NotifyApprovedSwtich(oSwitch); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text); } else { saveSwitch(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, txtDescription.Text.Trim()); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); int intHistoryID = clsHistory.insertHeader(PortfolioID(), intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text); } } if (strSMSMobileNo.Length != 0) { sendSMS(UserID(), strMessage, strPopupMessage, strSMSMobileNo); } } populateSwitchDetails(Portfolio().propSwitch.propSwitchDetails); pageStatus(Portfolio().propSwitch.propStatus); }
private void doSwitchSendSave(string strButtonClick) { captureSwitchGridviewDetails(); string strPortfolioName = Portfolio().propCompany; int intDiscretionary = int.Parse(Session["HasDiscretionary"].ToString()); clsSMS.subclsSMSTemplate osubclsSMSTemplate = new clsSMS.subclsSMSTemplate(clsSMS.subclsSMSTemplate.enumSMSTemplateID.ProposeSwitch); string strReplacerVariable = clsSMS.subclsSMSTemplate.strPortfolioNameVariable; string strMessage = osubclsSMSTemplate.propMessage.Replace(strReplacerVariable, strPortfolioName); string strPopupMessage = "Message sent."; string strSMSMobileNo = txtSMSMobileNo.Text.Trim(); if (strButtonClick == enumButton.Approve.ToString()) { List<clsSwitchDetails_Client> oSwitchDetailsClient = (List<clsSwitchDetails_Client>)Session["SwitchDetailsClient"]; int intSwitchID = oSwitchDetailsClient[0].propSwitchID; clsSwitchDetails.transferClientSwitchToIFA(oSwitchDetailsClient, UserID()); clsSwitch_Client.updateSwitchHeader(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, string.Empty); clsSwitch.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Proposed, txtDescription.Text); int intHistoryID = clsHistory.insertHeader(new clsSwitch(intSwitchID).propPortfolioID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text); if (strSMSMobileNo.Length != 0) { sendSMS(UserID(), strMessage, strPopupMessage, strSMSMobileNo); } string backPageURL = "https://" + Request.ServerVariables["SERVER_NAME"] + ":" + Request.ServerVariables["SERVER_PORT"] + "/report/" + "portfoliodetails.asp"; ClientScript.RegisterStartupScript(this.GetType(), "alertSaveSuccess", "alert('This Amended Switch has been approved.'); window.location='" + backPageURL + "';", true); } else if (strButtonClick == enumButton.Resubmit.ToString()) { int intSwitchID = Portfolio().propSwitch.propSwitchID; saveSwitch(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, txtDescription.Text); clsSwitch_Client.updateSwitchHeader(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, string.Empty); int intHistoryID = clsHistory.insertHeader(new clsSwitch(intSwitchID).propPortfolioID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text); if (strSMSMobileNo.Length != 0) { sendSMS(UserID(), strMessage, strPopupMessage, strSMSMobileNo); } } else { List<clsSwitchDetails> oSwitchDetails = (List<clsSwitchDetails>)Session["SwitchDetails"]; int intSwitchID = oSwitchDetails[0].propSwitchID; if (intSwitchID == 0) { if (intDiscretionary == 1 || intDiscretionary == -1) { saveSwitch(clsSwitch.enumSwitchStatus.Approved, null, txtDescription.Text.Trim()); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); int intHistoryID = clsHistory.insertHeader(PortfolioID(), intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Approved); NotifyApprovedSwtich(Portfolio()); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text.Trim()); } else { saveSwitch(clsSwitch.enumSwitchStatus.Proposed, null, txtDescription.Text.Trim()); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); int intHistoryID = clsHistory.insertHeader(PortfolioID(), oSwitch.propSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text.Trim()); } } else { if (intDiscretionary == 1 || intDiscretionary == -1) { saveSwitch(clsSwitch.enumSwitchStatus.Approved, intSwitchID, txtDescription.Text.Trim()); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); int intHistoryID = clsHistory.insertHeader(PortfolioID(), intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Approved); NotifyApprovedSwtich(Portfolio()); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text); } else { saveSwitch(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, txtDescription.Text.Trim()); clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); int intHistoryID = clsHistory.insertHeader(PortfolioID(), intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsHistory.insertDetailsIFA(intHistoryID, oSwitch.propSwitchDetails); clsHistory.insertMessage(intHistoryID, txtDescription.Text); } } if (strSMSMobileNo.Length != 0) { sendSMS(UserID(), strMessage, strPopupMessage, strSMSMobileNo); } } populateSwitchDetails(Portfolio().propSwitch.propSwitchDetails); pageStatus(Portfolio().propSwitch.propStatus); }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { if (Request["__EVENTARGUMENT"] == "SaveSwitchDetails") { btnSave_Click(); } else if (Request["__EVENTARGUMENT"] == "ChangeFund") { replaceFund(int.Parse(this.hfFundIDOrig.Value), int.Parse(this.hfFundIDNew.Value)); } else if (Request["__EVENTARGUMENT"] == "AddMoreFund") { addNewFund(int.Parse(this.hfFundIDNew.Value)); } } else { Session["SourcePage"] = "/report/portfoliodetails.asp"; string strSurname = Session[clsSystem_Session.strSession.surname.ToString()].ToString(); string strForename = Session[clsSystem_Session.strSession.Forenames.ToString()].ToString(); string strCode = Session[clsSystem_Session.strSession.code.ToString()].ToString(); if (Session[clsSystem_Session.strSession.showname.ToString()].ToString() == "yes") { if (Session[clsSystem_Session.strSession.surname.ToString()] == null) { strPortfolioName = "Portfolio Details"; } else { if (Session[clsSystem_Session.strSession.lang.ToString()].ToString() == "2") { strPortfolioName = string.Format("{0} {1}({2})", strSurname, strForename, strCode); } else { strPortfolioName = string.Format("{1} {0}({2})", strSurname, strForename, strCode); } } } else { strPortfolioName = Session[clsSystem_Session.strSession.code.ToString()].ToString(); } Session["SwitchDetails"] = null; Session["HasDiscretionary"] = Portfolio().propPortfolioDetails[0].propMFPercent; setSessionCodepage(); populateHeader(Portfolio(), strPortfolioName); this.populateDetails(Portfolio().propPortfolioDetails); //Session["SwitchDetails"] = Portfolio().propSwitch.propSwitchDetails; if (Portfolio().propSwitch.propStatus == (int)clsSwitch.enumSwitchStatus.Amended) { clsSwitch_Client oClientSwitch = new clsSwitch_Client(Portfolio().propSwitch.propSwitchID); populateSwitchDetailsClient(oClientSwitch); } //if (Portfolio().propSwitch.propSwitchDetails[0].propSwitchID == 0) //{ // saveSwitch(clsSwitch.enumSwitchStatus.Draft, null, string.Empty); //} clsSwitch oSwitch = new clsSwitch(Portfolio(), UserID()); populateSwitchDetails(oSwitch.propSwitchDetails); pageStatus(Portfolio().propSwitch.propStatus); } }
protected void NotifyApprovedSwtich(clsSwitch Switch) { try { int intIFAID = int.Parse(Session["ifaid"].ToString()); clsIFA IFA = new clsIFA(intIFAID); string htmlTemplate = clsOutput.generateApprovedSwitch(Switch, IFA.propIFA_ID); StyleSheet style = clsOutput.getStyleSheet_ApprovedSwitch(); string strFilename = clsOutput.generateOutputFile(clsOutput.enumOutputType.PDF, htmlTemplate, style, Switch.propSwitchID, clsOutput.enumSwitchType.Portfolio); string strRecepient = IFA.propIFAEmail; string strSender = "*****@*****.**"; string strSubject = "Switch Instruction"; string strBody = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyApprovedEmailReqSign" : "NotifyApprovedEmail"), null, null, null, null, null, Switch.propPortfolio.propCompany, Switch.propSwitchID.ToString()); clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename); clsClient client = new clsClient(Switch.propClientID); string ClientName = client.propForename + " " + client.propSurname; if (!String.IsNullOrEmpty(client.propEmailWork)) { strRecepient = client.propEmailWork; strBody = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Switch.propPortfolio.propCompany, null); clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename); } if (!String.IsNullOrEmpty(client.propEmailPersonal)) { strRecepient = client.propEmailPersonal; strBody = clsEmail.generateEmailBody((Switch.propPortfolio.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Switch.propPortfolio.propCompany, null); clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, Switch.propSwitchID, Switch.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename); } //:SwitchType_IFA Name_Client Name_yyyy-mm-dd.pdf } catch (Exception ex) { Response.Write("Exception Occured<br/>"); Response.Write(String.Format("<p>{0}</p><br/>", ex.ToString())); } }