protected void Page_Load(object sender, EventArgs e) { //Session["SourcePage"] = "schemedetails.asp"; //Devt Session["SourcePage"] = "/report/schemedetails.asp"; //Deploy String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); clsSwitchScheme SwitchScheme = new clsSwitchScheme(Scheme); int intSwitchID = SwitchScheme.propSwitchID; this.ucProposalDisplay1.propUserLevel = global::NAV.Scheme.UserControl.ucProposalDisplay.enumUserLevel.Client; this.ucProposalDisplay1.propSwitchID = intSwitchID; this.ucSwitchDetailsClient1.propSwitchID = intSwitchID; this.ucSwitchDetailsClient1.propBackPageURL = "https://" + Request.ServerVariables["SERVER_NAME"] + ":" + Request.ServerVariables["SERVER_PORT"] + "/report/schemedetails.asp"; switch (SwitchScheme.propStatus) { case (short)clsSwitch.enumSwitchStatus.Amended: this.ucProposalDisplay2.Visible = true; this.ucProposalDisplay2.propSwitchID = SwitchScheme.propSwitchID; this.ucProposalDisplay2.propUserLevel = global::NAV.Scheme.UserControl.ucProposalDisplay.enumUserLevel.IFA; break; default: break; } }
private void btnSave_Click() { List <clsSwitchScheme.clsSwitchSchemeDetails> ListSwitchDetails = (List <clsSwitchScheme.clsSwitchSchemeDetails>)Session["listSwitchDetails"]; String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); captureSwitchGridviewDetails(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); if (ListSwitchDetails[0].propSwitchScheme != null) { int intSwitchID = ListSwitchDetails[0].propSwitchScheme.propSwitchID; saveSwitch(clsSwitch.enumSwitchStatus.Saved, intSwitchID, string.Empty, strUserID, Scheme); } else { saveSwitch(clsSwitch.enumSwitchStatus.Saved, null, string.Empty, strUserID, Scheme); } populate(ListSwitchDetails, false); populate(ListSwitchDetails, true); Page.ClientScript.RegisterStartupScript(this.GetType(), "alertSaveSuccess", "alert('This Switch has been saved.'); window.location='" + this.propBackPageURL + "';", true); }
private void replaceFund(int intOldFundID, int intNewFundID, Boolean isContribution) { captureSwitchGridviewDetails(); string strSessionDetailsSet = isContribution ? "SwitchSchemeDetailsContribution_Client" : "SwitchSchemeDetailsPortfolio_Client"; List <clsSwitchScheme_Client.clsSwitchSchemeDetails_Client> PreviousListSwitchDetails = (List <clsSwitchScheme_Client.clsSwitchSchemeDetails_Client>)Session[strSessionDetailsSet]; String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); List <clsSwitchScheme_Client.clsSwitchSchemeDetails_Client> newListSwitchDetails = new List <clsSwitchScheme_Client.clsSwitchSchemeDetails_Client>(); try { newListSwitchDetails = clsSwitchScheme_Client.clsSwitchSchemeDetails_Client.FundChange(intOldFundID, intNewFundID, PreviousListSwitchDetails, strClientID, Scheme.propClient.propCurrency, false); Session[strSessionDetailsSet] = newListSwitchDetails; populate((List <clsSwitchScheme_Client.clsSwitchSchemeDetails_Client>)Session[strSessionDetailsSet], isContribution); } catch (Exception ex) { populate((List <clsSwitchScheme_Client.clsSwitchSchemeDetails_Client>)Session[strSessionDetailsSet], isContribution); Page.ClientScript.RegisterStartupScript(this.GetType(), "errDuplicateFund", "alert('" + ex.Message + "');", true); return; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); Session["listSwitchDetails"] = new clsSwitchScheme(Scheme, strUserID).propSwitchDetails; Session["listSwitchContributionDetails"] = new clsSwitchScheme(Scheme, strUserID).propSwitchDetailsContribution; Session["HasDiscretionary"] = Scheme.propMFPercent; populate((List<clsSwitchScheme.clsSwitchSchemeDetails>)Session["listSwitchDetails"], false); populate((List<clsSwitchScheme.clsSwitchSchemeDetails>)Session["listSwitchContributionDetails"], true); pageStatus(new clsSwitchScheme(Scheme).propStatus); if (Scheme.propDetails.Count == 0) { pageStatus((int)clsSwitch.enumSwitchStatus.Locked); } } else { if (Request["__EVENTARGUMENT"] == "SaveSwitchDetails") { btnSave_Click(); } else if (Request["__EVENTARGUMENT"] == "ChangeFund") { replaceFund(int.Parse(this.hfFundIDOrig.Value), int.Parse(this.hfFundIDNew.Value), Boolean.Parse(this.hfIsContribution.Value)); } else if (Request["__EVENTARGUMENT"] == "AddMoreFund") { addNewFund(int.Parse(this.hfFundIDNew.Value), Boolean.Parse(this.hfIsContribution.Value)); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); clsSwitchScheme SwitchScheme = new clsSwitchScheme(Scheme); Session["IFAPermit"] = Scheme.propSwitchIFAPermit; enableButtons((clsSwitch.enumSwitchStatus)SwitchScheme.propStatus); showhideButtons(enumPageState.view); if (SwitchScheme.propStatus == (int)clsSwitch.enumSwitchStatus.Amended) { showhideAmendArea(false); } } else { if (Request["__EVENTARGUMENT"] == "SaveSwitchDetails") { btnSave_Click(); } else if (Request["__EVENTARGUMENT"] == "ChangeFund") { replaceFund(int.Parse(this.hfFundIDOrig.Value), int.Parse(this.hfFundIDNew.Value), Boolean.Parse(this.hfIsContribution.Value)); } else if (Request["__EVENTARGUMENT"] == "AddMoreFund") { addNewFund(int.Parse(this.hfFundIDNew.Value), Boolean.Parse(this.hfIsContribution.Value)); } } }
protected void btnSMSResetSend_Click(object sender, EventArgs e) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); clsSwitchScheme SwitchScheme = new clsSwitchScheme(Scheme); int intSwitchID = SwitchScheme.propSwitchID; string strSchemeName = SwitchScheme.propScheme.propCompany.propCompany; string strPopupMessage = "Switch is now unlocked"; string strSMSMobileNo = this.txtMobileNoResetCode.Text.Trim(); doSwitch(intSwitchID, strSchemeName, clsSMS.subclsSMSTemplate.enumSMSTemplateID.Reset, strPopupMessage, strSMSMobileNo); }
protected void lbtnHistory_Click(object sender, EventArgs e) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); clsSwitchScheme SwitchScheme = new clsSwitchScheme(Scheme); string strSwitchID = SwitchScheme.propSwitchID.ToString(); String strHistoryURL = "SchemeHistory.aspx?SID=" + strSwitchID + "&SchID=" + strSchemeID + "&CID=" + strClientID; Session["SourcePage"] = "/ASPX/Scheme/Scheme.aspx"; Response.Redirect(strHistoryURL); }
protected void btnComplete_Click(object sender, EventArgs e) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); clsSwitchScheme SwitchScheme = new clsSwitchScheme(Scheme); int intSwitchID = SwitchScheme.propSwitchID; clsSwitchScheme.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Completed); clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (short)clsSwitch.enumSwitchStatus.Completed); Page.ClientScript.RegisterStartupScript(this.GetType(), "alertCompletedSwitch", "alert('This Switch has been finally completed.'); window.location='" + this.propBackPageURL + "';", true); }
protected void btnContactMeSend_Click(object sender, EventArgs e) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsIFA IFA = new clsIFA(int.Parse(Session["ifaid"].ToString())); clsClient Client = new clsClient(strClientID); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); int intSwitchID = propSwitchID; String strEmailMessage = ""; try { String strRecipient = IFA.propIFAEmail; try { strEmailMessage = clsEmail.generateEmailBody("ClientRequestContact", IFA.propIFA_Name, Client.propForename + " " + Client.propSurname, Scheme.propCompany.propCompany, this.txtContactMeByTel.Text.Trim(), this.txtContactMeComments.Text.Trim(), null, null); strEmailMessage = Server.HtmlDecode(strEmailMessage); } catch { Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertNoEmailTemplate", "alert('System error! No email template found for this purpose. Please report this error to your systems administrator');", true); return; } clsEmail.Send(strRecipient, "*****@*****.**", "NAV-Switch client request", strEmailMessage, propSwitchID, strClientID, clsEmail.enumEmailPurpose.ClientRequestingContactScheme); clsSwitchScheme.updateSwitchHeader(propSwitchID, clsSwitch.enumSwitchStatus.Request_ForDiscussion); int intHistoryID = clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Request_ForDiscussion); clsHistory.clsHistoryScheme.insertMessage(intHistoryID, strEmailMessage); Page.ClientScript.RegisterStartupScript(this.GetType(), "EmailRequestContactSent", "alert('Request for contact to your IFA has been sent successfully'); window.location='" + this.propBackPageURL + "';", true); } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "EmailFailedAlert", "alert('Sending failed. Error: " + ex.Message.Replace("'", " ") + "');", true); return; } }
private void populate(String strClientID, String strSchemeID) { clsScheme Scheme = new clsScheme(strClientID, strSchemeID); this.gvCurrentHoldings.DataSource = Scheme.propDetails; this.gvCurrentHoldings.DataBind(); Label lblgvFooterValueFundCur = (Label)this.gvCurrentHoldings.FooterRow.Cells[3].FindControl("gvFooterValueFundCur"); lblgvFooterValueFundCur.Text = Scheme.propSC_TotalValue.ToString("n0"); Label lblgvFooterCurrentValueClient = (Label)this.gvCurrentHoldings.FooterRow.Cells[4].FindControl("gvFooterCurrentValueClient"); lblgvFooterCurrentValueClient.Text = Scheme.propCC_TotalValue.ToString("n0"); Label lblgvHeaderClientCurrency = (Label)this.gvCurrentHoldings.HeaderRow.Cells[4].FindControl("gvHeaderClientCurrency"); lblgvHeaderClientCurrency.Text = Scheme.propClient.propCurrency.ToString(); }
protected void btnDeclineSwitch_Click(object sender, EventArgs e) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); int intSwitchID = propSwitchID; try { clsIFA IFA = new clsIFA(int.Parse(Session["ifaid"].ToString())); clsClient Client = new clsClient(strClientID); String strEmailMessage = ""; String strRecipient = IFA.propIFAEmail; try { strEmailMessage = clsEmail.generateEmailBody("ClientDeclineNotification", IFA.propIFA_Name, Client.propForename + " " + Client.propSurname, Scheme.propCompany.propCompany, null, this.txtDeclineDescription.Text.Trim(), null, null); } catch { Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertNoEmailTemplate", "alert('System error! No email template found for declining email. Please report this error to your systems administrator');", true); return; } clsEmail.Send(strRecipient, "*****@*****.**", "NAV-Switch client declined proposed switch", strEmailMessage, intSwitchID, strClientID, clsEmail.enumEmailPurpose.ClientDeclinedSwitchScheme); clsSwitchScheme.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Declined_Client, new clsSwitch(intSwitchID).propDescription); int intHistoryID = clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Declined_Client); clsHistory.clsHistoryScheme.insertMessage(intHistoryID, strEmailMessage); clsSwitchScheme_Client.declineSwitch(intSwitchID); Page.ClientScript.RegisterStartupScript(this.GetType(), "alertDeclinedSwitch", "alert('This switch has been declined.'); window.location='" + this.propBackPageURL + "';", true); } catch (Exception ex) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alertDeclinedSwitcherror", "alert('Error declining switch! " + ex.ToString().Replace("'", " ") + "'); window.location='" + this.propBackPageURL + "';", true); } }
private void populate(String strClientID, String strSchemeID) { clsScheme Scheme = new clsScheme(strClientID, strSchemeID); this.gvCurrentHoldings.DataSource = Scheme.propDetails; this.gvCurrentHoldings.DataBind(); if (Scheme.propDetails.Count != 0) { Label lblgvFooterValueFundCur = (Label)this.gvCurrentHoldings.FooterRow.Cells[3].FindControl("gvFooterValueFundCur"); lblgvFooterValueFundCur.Text = Scheme.propSC_TotalValue.ToString("n0"); Label lblgvFooterCurrentValueClient = (Label)this.gvCurrentHoldings.FooterRow.Cells[4].FindControl("gvFooterCurrentValueClient"); lblgvFooterCurrentValueClient.Text = Scheme.propCC_TotalValue.ToString("n0"); Label lblgvHeaderClientCurrency = (Label)this.gvCurrentHoldings.HeaderRow.Cells[4].FindControl("gvHeaderClientCurrency"); lblgvHeaderClientCurrency.Text = Scheme.propClient.propCurrency.ToString(); } }
protected void NotifyApprovedSwtich() { //try //{ String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); clsSwitchScheme switchScheme = new clsSwitchScheme(Scheme); string htmlTemplate = clsOutput.generateApprovedSwitchScheme(Scheme); StyleSheet style = clsOutput.getStyleSheet_ApprovedSwitch(); string strFilename = clsOutput.generateOutputFile(clsOutput.enumOutputType.PDF, htmlTemplate, style, switchScheme.propSwitchID, clsOutput.enumSwitchType.Scheme); int intIFAID = int.Parse(Session["ifaid"].ToString()); string strRecepient = (new clsIFA(intIFAID)).propIFAEmail; string strSender = "*****@*****.**"; string strSubject = "Switch Instruction"; string strBody = clsEmail.generateEmailBody((Scheme.propConfirmationRequired ? "NotifyApprovedEmailReqSign" : "NotifyApprovedEmail"), null, null, null, null, null, Scheme.propCompany.propCompany, switchScheme.propSwitchID.ToString()); clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, switchScheme.propSwitchID, switchScheme.propClient.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename); clsClient client = new clsClient(Scheme.propClient.propClientID); string ClientName = client.propForename + " " + client.propSurname; if (!String.IsNullOrEmpty(client.propEmailWork)) { strRecepient = client.propEmailWork; strBody = clsEmail.generateEmailBody((Scheme.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Scheme.propCompany.propCompany, null); clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, switchScheme.propSwitchID, Scheme.propClient.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename); } if (!String.IsNullOrEmpty(client.propEmailPersonal)) { strRecepient = client.propEmailPersonal; strBody = clsEmail.generateEmailBody((Scheme.propConfirmationRequired ? "NotifyClientApprovedEmailReqSign" : "NotifyClientApprovedEmail"), null, null, ClientName, null, null, Scheme.propCompany.propCompany, null); clsEmail.SendWithAttachment(strRecepient, strSender, strSubject, strBody, switchScheme.propSwitchID, Scheme.propClient.propClientID, clsEmail.enumEmailPurpose.ApproveSwitchNotification, strFilename); } //} //catch (Exception e) //{ // Response.Write("<p>" + e.ToString() + "</p>"); //} }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); Session["listSwitchDetails"] = new clsSwitchScheme(Scheme, strUserID).propSwitchDetails; Session["listSwitchContributionDetails"] = new clsSwitchScheme(Scheme, strUserID).propSwitchDetailsContribution; Session["HasDiscretionary"] = Scheme.propMFPercent; populate((List <clsSwitchScheme.clsSwitchSchemeDetails>)Session["listSwitchDetails"], false); populate((List <clsSwitchScheme.clsSwitchSchemeDetails>)Session["listSwitchContributionDetails"], true); pageStatus(new clsSwitchScheme(Scheme).propStatus); if (Scheme.propDetails.Count == 0) { pageStatus((int)clsSwitch.enumSwitchStatus.Locked); } } else { if (Request["__EVENTARGUMENT"] == "SaveSwitchDetails") { btnSave_Click(); } else if (Request["__EVENTARGUMENT"] == "ChangeFund") { replaceFund(int.Parse(this.hfFundIDOrig.Value), int.Parse(this.hfFundIDNew.Value), Boolean.Parse(this.hfIsContribution.Value)); } else if (Request["__EVENTARGUMENT"] == "AddMoreFund") { addNewFund(int.Parse(this.hfFundIDNew.Value), Boolean.Parse(this.hfIsContribution.Value)); } } }
private void sendValidationCode(string strSMSMobileNo) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); int intSwitchID = propSwitchID; clsScheme Scheme = new clsScheme(strClientID, strSchemeID); string strSecurityCode = GenerateSecurityCode(intSwitchID, strClientID, strSchemeID); string strMessage = clsSMS.subclsSMSTemplate.getSMSTemplate(clsSMS.subclsSMSTemplate.enumSMSTemplateID.SecurityCodeScheme.ToString()); strMessage = clsSMS.subclsSMSTemplate.convertSMSMessage(strMessage, null, null, null, strSecurityCode, Scheme); if (!strSMSMobileNo.Trim().Equals(string.Empty)) { sendSMS(strUserID, strMessage, strSMSMobileNo); } Page.ClientScript.RegisterStartupScript(this.GetType(), "showSecurityCode", string.Format("showSecurityCodePanel();"), true); }
private void populate(String strClientID, String strSchemeID) { clsScheme Scheme = new clsScheme(strClientID, strSchemeID); this.lblValue_AccountNumber.Text = Scheme.propAccountNumber; this.lblValue_ClientName.Text = Scheme.propClient.propForename + " " + Scheme.propClient.propSurname; this.lblValue_Company.Text = Scheme.propCompany.propCompany; this.lblValue_Currency.Text = Scheme.propSchemeCurrency; this.lblValue_Discretionary.Text = Scheme.propMFPercent == 0 ? "no" : "yes"; this.lblValue_MaturityDate.Text = Scheme.propMaturityDate.ToString("dd/MM/yyyy") == "01/01/1800" ? "" : Scheme.propMaturityDate.ToString("dd/MM/yyyy"); this.lblValue_PlanStatus.Text = Scheme.propPlanStatus.ToString(); this.lblValue_PolicyCategory.Text = Scheme.propLiquidity.ToString(); this.lblValue_PortfolioType.Text = Scheme.propPortfolioType.ToString(); this.lblValue_Profile.Text = Scheme.propRiskProfile.ToString(); this.lblValue_SchemeCurrency.Text = Scheme.propSchemeCurrency.ToString(); this.lblValue_SpecialistInformation.Text = Scheme.propRetentionTerm.ToString(); this.lblValue_StartDate.Text = Scheme.propStartDate.ToString("dd/MM/yyyy"); this.lblValue_TotalContribution.Text = Scheme.propContributionTotal.ToString("n0"); this.lblValue_GainLossValue.Text = "(" + Math.Abs(float.Parse(Scheme.propGainLoss.ToString())).ToString("n0") + ")"; this.lblValue_GainLossPercent.Text = "(" + Math.Abs(float.Parse(Scheme.propGainLossPercent.ToString())).ToString("n2") + " %)";; this.lblValue_GainLossValue.ForeColor = Scheme.propGainLoss < 0 ? System.Drawing.Color.Red : System.Drawing.Color.Green; this.lblValue_GainLossPercent.ForeColor = Scheme.propGainLossPercent < 0 ? System.Drawing.Color.Red : System.Drawing.Color.Green; }
protected void btnReject_Click(object sender, EventArgs e) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); clsSwitchScheme SwitchScheme = new clsSwitchScheme(Scheme); int intSwitchID = SwitchScheme.propSwitchID; this.lblSwitchStatusTitle.Visible = true; this.lblSwitchStatusValue.Visible = true; //gvSwitchDetails.Visible = true; divSwitch.Visible = true; divAmend.Visible = false; Button ButtonClick = (Button)sender; ViewState["Button"] = ButtonClick.Text; clsSwitchScheme_Client.updateSwitchHeader(clsSwitch.enumSwitchStatus.Declined_IFA, intSwitchID, new clsSwitchScheme_Client(intSwitchID).propDescription); isShowEditablePanel(true); }
protected void Page_Load(object sender, EventArgs e) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); clsSwitchScheme SwitchScheme = new clsSwitchScheme(Scheme); switch (SwitchScheme.propStatus) { case (short)clsSwitch.enumSwitchStatus.Amended: this.ucProposalDisplay1.Visible = true; this.ucProposalDisplay1.propSwitchID = SwitchScheme.propSwitchID; this.ucProposalDisplay1.propUserLevel = global::NAV.Scheme.UserControl.ucProposalDisplay.enumUserLevel.Client; this.ucProposalDisplay2.Visible = true; this.ucProposalDisplay2.propSwitchID = SwitchScheme.propSwitchID; this.ucProposalDisplay2.propUserLevel = global::NAV.Scheme.UserControl.ucProposalDisplay.enumUserLevel.IFA; break; case (short)clsSwitch.enumSwitchStatus.Proposed: this.ucProposalDisplay2.Visible = true; this.ucProposalDisplay2.propSwitchID = SwitchScheme.propSwitchID; this.ucProposalDisplay2.propUserLevel = global::NAV.Scheme.UserControl.ucProposalDisplay.enumUserLevel.Client; break; case (short)clsSwitch.enumSwitchStatus.Request_ForDiscussion: this.ucProposalDisplay1.Visible = true; this.ucProposalDisplay1.propSwitchID = SwitchScheme.propSwitchID; this.ucProposalDisplay1.propUserLevel = global::NAV.Scheme.UserControl.ucProposalDisplay.enumUserLevel.Client; break; case (short)clsSwitch.enumSwitchStatus.Declined_IFA: this.ucProposalDisplay1.Visible = true; this.ucProposalDisplay1.propSwitchID = SwitchScheme.propSwitchID; this.ucProposalDisplay1.propUserLevel = global::NAV.Scheme.UserControl.ucProposalDisplay.enumUserLevel.Client; this.ucProposalDisplay2.Visible = true; this.ucProposalDisplay2.propSwitchID = SwitchScheme.propSwitchID; this.ucProposalDisplay2.propUserLevel = global::NAV.Scheme.UserControl.ucProposalDisplay.enumUserLevel.IFA; break; case (short)clsSwitch.enumSwitchStatus.Approved: this.ucProposalDisplay1.Visible = true; this.ucProposalDisplay1.propSwitchID = SwitchScheme.propSwitchID; this.ucProposalDisplay1.propUserLevel = global::NAV.Scheme.UserControl.ucProposalDisplay.enumUserLevel.Client; break; case (short)clsSwitch.enumSwitchStatus.Completed: this.ucProposalDisplay1.Visible = true; this.ucProposalDisplay1.propSwitchID = SwitchScheme.propSwitchID; this.ucProposalDisplay1.propUserLevel = global::NAV.Scheme.UserControl.ucProposalDisplay.enumUserLevel.Client; break; case (short)clsSwitch.enumSwitchStatus.Locked: this.ucProposalDisplay1.Visible = true; this.ucProposalDisplay1.propSwitchID = SwitchScheme.propSwitchID; this.ucProposalDisplay1.propUserLevel = global::NAV.Scheme.UserControl.ucProposalDisplay.enumUserLevel.Client; break; default: break; } if (SwitchScheme.propStatus != (int)clsSwitch.enumSwitchStatus.Locked) { btnResetSecurityCode.Visible = false; } }
private void btnSave_Click() { List<clsSwitchScheme.clsSwitchSchemeDetails> ListSwitchDetails = (List<clsSwitchScheme.clsSwitchSchemeDetails>)Session["listSwitchDetails"]; String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); captureSwitchGridviewDetails(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); if (ListSwitchDetails[0].propSwitchScheme != null) { int intSwitchID = ListSwitchDetails[0].propSwitchScheme.propSwitchID; saveSwitch(clsSwitch.enumSwitchStatus.Saved, intSwitchID, string.Empty, strUserID, Scheme); } else { saveSwitch(clsSwitch.enumSwitchStatus.Saved, null, string.Empty, strUserID, Scheme); } populate(ListSwitchDetails,false); populate(ListSwitchDetails, true); Page.ClientScript.RegisterStartupScript(this.GetType(), "alertSaveSuccess", "alert('This Switch has been saved.'); window.location='" + this.propBackPageURL + "';", true); }
private void doSwitchSendSave(string strButtonClick) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); captureSwitchGridviewDetails(); List<clsSwitchScheme.clsSwitchSchemeDetails> SwitchDetails = (List<clsSwitchScheme.clsSwitchSchemeDetails>)Session["listSwitchDetails"]; clsScheme Scheme = new clsScheme(strClientID, strSchemeID); string strSchemeName = Scheme.propCompany.propCompany; int intDiscretionary = int.Parse(Session["HasDiscretionary"].ToString()); int intSwitchID = SwitchDetails[0].propSwitchScheme.propSwitchID; if (strButtonClick == enumButton.Approve.ToString()) { clsSwitchScheme.clsSwitchSchemeDetails.deleteAllDetails(intSwitchID); clsSwitchScheme.clsSwitchSchemeDetails.transferClientSwitchToIFA(new clsSwitchScheme_Client(intSwitchID).propSwitchDetailsPortfolio, strUserID, false, true); clsSwitchScheme.clsSwitchSchemeDetails.transferClientSwitchToIFA(new clsSwitchScheme_Client(intSwitchID).propSwitchDetailsContribution, strUserID, true, false); clsSwitchScheme_Client.updateSwitchHeader(clsSwitch.enumSwitchStatus.Approved, intSwitchID, string.Empty); clsSwitchScheme.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Approved); int intHistoryID = clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Approved); clsSwitchScheme SwitchScheme = new clsSwitchScheme(intSwitchID); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetails, false); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetailsContribution, true); clsHistory.clsHistoryScheme.insertMessage(intHistoryID, txtDescription.Text); } else if (strButtonClick == enumButton.Resubmit.ToString()) { saveSwitch(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, txtDescription.Text, strUserID, Scheme); clsSwitchScheme_Client.updateSwitchHeader(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, string.Empty); int intHistoryID = clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsSwitchScheme SwitchScheme = new clsSwitchScheme(intSwitchID); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetails, false); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetailsContribution, true); clsHistory.clsHistoryScheme.insertMessage(intHistoryID, txtDescription.Text); } else { clsSwitch.enumSwitchStatus status = (intDiscretionary == 1 || intDiscretionary == -1) ? clsSwitch.enumSwitchStatus.Approved : clsSwitch.enumSwitchStatus.Proposed; if (intSwitchID == 0) { saveSwitch(status, null, txtDescription.Text.Trim(), strUserID, Scheme); } else { saveSwitch(status, intSwitchID, txtDescription.Text.Trim(), strUserID, Scheme); } intSwitchID = new clsSwitchScheme(Scheme).propSwitchID; clsSwitchScheme SwitchScheme = new clsSwitchScheme(intSwitchID); int intHistoryID = clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetails, false); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetailsContribution, true); clsHistory.clsHistoryScheme.insertMessage(intHistoryID, txtDescription.Text); } string strMessage = clsSMS.subclsSMSTemplate.getSMSTemplate(clsSMS.subclsSMSTemplate.enumSMSTemplateID.ProposeSchemeSwitch.ToString()); strMessage = clsSMS.subclsSMSTemplate.convertSMSMessage(strMessage, null, null, null, null, Scheme); string strPopupMessage = "Message sent."; string strSMSMobileNo = txtSMSMobileNo.Text.Trim(); if (strSMSMobileNo.Length != 0) { sendSMS(strUserID, strMessage, strPopupMessage, strSMSMobileNo); } Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + strPopupMessage + "'); window.location='" + this.propBackPageURL + "';", true); }
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 replaceFund(int intOldFundID, int intNewFundID, Boolean isContribution) { captureSwitchGridviewDetails(); string strSessionDetailsSet = isContribution ? "listSwitchContributionDetails" : "listSwitchDetails"; List<clsSwitchScheme.clsSwitchSchemeDetails> PreviousListSwitchDetails = (List<clsSwitchScheme.clsSwitchSchemeDetails>)Session[strSessionDetailsSet]; String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); List<clsSwitchScheme.clsSwitchSchemeDetails> newListSwitchDetails = new List<clsSwitchScheme.clsSwitchSchemeDetails>(); try { newListSwitchDetails = clsSwitchScheme.clsSwitchSchemeDetails.FundChange(intOldFundID, intNewFundID, PreviousListSwitchDetails, strClientID, Scheme.propClient.propCurrency, false); Session[strSessionDetailsSet] = newListSwitchDetails; populate(newListSwitchDetails, isContribution); } catch (Exception ex) { populate((List<clsSwitchScheme.clsSwitchSchemeDetails>)Session["strSessionDetailsSet"], isContribution); Page.ClientScript.RegisterStartupScript(this.GetType(), "errDuplicateFund", "alert('" + ex.Message + "');", true); return; } }
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); }
protected void Page_Load(object sender, EventArgs e) { int intSwitchID = int.Parse(Request.QueryString["SID"].ToString()); string strSchemeID = Request.QueryString["SchID"].ToString(); string strClientID = Request.QueryString["CID"].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); foreach (clsHistory.clsHistoryScheme History in clsHistory.clsHistoryScheme.getListHistory(strSchemeID, intSwitchID)) { switch (History.propStatus) { case 0: //draft break; case 1: //save break; case 2: //proposed ucProposalDisplay ucProposed = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucProposed.propUserLevel = ucProposalDisplay.enumUserLevel.Client; ucProposed.propIsDetailsAsGivenParameter = true; ucProposed.propSwitchDetailsList = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, false)); ucProposed.propSwitchDetailsListContribution = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, true)); ucProposed.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucProposed.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucProposed); break; case 3: //amended ucProposalDisplay ucAmended = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucAmended.propUserLevel = ucProposalDisplay.enumUserLevel.IFA; ucAmended.propIsDetailsAsGivenParameter = true; ucAmended.propSwitchDetailsList = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, false)); ucAmended.propSwitchDetailsListContribution = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, true)); ucAmended.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucAmended.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucAmended); break; case 4: //decline IFA break; case 5: //decline Client ucProposalDisplay ucDeclinedClient = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucDeclinedClient.propUserLevel = ucProposalDisplay.enumUserLevel.Client; ucDeclinedClient.propIsDetailsAsGivenParameter = true; ucDeclinedClient.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucDeclinedClient.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucDeclinedClient); break; case 6: //Approved ucProposalDisplay ucApproved = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucApproved.propUserLevel = ucProposalDisplay.enumUserLevel.Client; ucApproved.propIsDetailsAsGivenParameter = true; ucApproved.propSwitchDetailsList = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, false)); ucApproved.propSwitchDetailsListContribution = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, true)); ucApproved.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucApproved.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucApproved); break; case 7: //lock break; case 8: //request for discussion ucProposalDisplay ucRequest = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucRequest.propUserLevel = ucProposalDisplay.enumUserLevel.Client; ucRequest.propIsDetailsAsGivenParameter = true; ucRequest.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucRequest.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucRequest); break; case 9: //Cancelled ucProposalDisplay ucCancelled = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucCancelled.propUserLevel = ucProposalDisplay.enumUserLevel.Client; ucCancelled.propIsDetailsAsGivenParameter = true; ucCancelled.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucCancelled.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucCancelled); break; case 10: //Completed ucProposalDisplay ucCompleted = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucCompleted.propUserLevel = ucProposalDisplay.enumUserLevel.Client; ucCompleted.propIsDetailsAsGivenParameter = true; ucCompleted.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucCompleted.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucCompleted); break; } } }
protected void Page_Load(object sender, EventArgs e) { int intSwitchID = int.Parse(Request.QueryString["SID"].ToString()); string strSchemeID = Request.QueryString["SchID"].ToString(); string strClientID = Request.QueryString["CID"].ToString(); clsScheme Scheme = new clsScheme(strClientID, strSchemeID); foreach (clsHistory.clsHistoryScheme History in clsHistory.clsHistoryScheme.getListHistory(strSchemeID, intSwitchID)) { switch (History.propStatus) { case 0: //draft break; case 1: //save break; case 2: //proposed ucProposalDisplay ucProposed = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucProposed.propUserLevel = ucProposalDisplay.enumUserLevel.Client; ucProposed.propIsDetailsAsGivenParameter = true; ucProposed.propSwitchDetailsList = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, false)); ucProposed.propSwitchDetailsListContribution = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, true)); ucProposed.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucProposed.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucProposed); break; case 3: //amended ucProposalDisplay ucAmended = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucAmended.propUserLevel = ucProposalDisplay.enumUserLevel.IFA; ucAmended.propIsDetailsAsGivenParameter = true; ucAmended.propSwitchDetailsList = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, false)); ucAmended.propSwitchDetailsListContribution = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, true)); ucAmended.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucAmended.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucAmended); break; case 4: //decline IFA break; case 5: //decline Client ucProposalDisplay ucDeclinedClient = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucDeclinedClient.propUserLevel = ucProposalDisplay.enumUserLevel.Client; ucDeclinedClient.propIsDetailsAsGivenParameter = true; ucDeclinedClient.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucDeclinedClient.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucDeclinedClient); break; case 6: //Approved ucProposalDisplay ucApproved = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucApproved.propUserLevel = ucProposalDisplay.enumUserLevel.Client; ucApproved.propIsDetailsAsGivenParameter = true; ucApproved.propSwitchDetailsList = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, false)); ucApproved.propSwitchDetailsListContribution = ucProposalDisplay.clsSwitchDetailsList.convertSwitchDetails(clsHistory.clsHistoryScheme.getSwitchDetails(Scheme, intSwitchID, History.propHistoryID, true)); ucApproved.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucApproved.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucApproved); break; case 7: //lock break; case 8: //request for discussion ucProposalDisplay ucRequest = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucRequest.propUserLevel = ucProposalDisplay.enumUserLevel.Client; ucRequest.propIsDetailsAsGivenParameter = true; ucRequest.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucRequest.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucRequest); break; case 9: //Cancelled break; case 10: //Completed ucProposalDisplay ucCompleted = (ucProposalDisplay)LoadControl("UserControl/ucProposalDisplay.ascx"); ucCompleted.propUserLevel = ucProposalDisplay.enumUserLevel.Client; ucCompleted.propIsDetailsAsGivenParameter = true; ucCompleted.propStatus = clsSwitch.getSwitchStringStatus(History.propStatus) + " (" + History.propAction_Date + ")"; ucCompleted.propDescription = clsHistory.clsHistoryScheme.getMessage(History.propHistoryID); this.divHistoryHolder.Controls.Add(ucCompleted); break; } } }
private void doSwitchSendSave(string strButtonClick) { String strSchemeID = Session[clsSystem_Session.strSession.tempschemeid.ToString()].ToString(); String strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); String strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); captureSwitchGridviewDetails(); List <clsSwitchScheme.clsSwitchSchemeDetails> SwitchDetails = (List <clsSwitchScheme.clsSwitchSchemeDetails>)Session["listSwitchDetails"]; clsScheme Scheme = new clsScheme(strClientID, strSchemeID); string strSchemeName = Scheme.propCompany.propCompany; int intDiscretionary = int.Parse(Session["HasDiscretionary"].ToString()); int intSwitchID = SwitchDetails[0].propSwitchScheme.propSwitchID; if (strButtonClick == enumButton.Approve.ToString()) { clsSwitchScheme.clsSwitchSchemeDetails.deleteAllDetails(intSwitchID); clsSwitchScheme.clsSwitchSchemeDetails.transferClientSwitchToIFA(new clsSwitchScheme_Client(intSwitchID).propSwitchDetailsPortfolio, strUserID, false, true); clsSwitchScheme.clsSwitchSchemeDetails.transferClientSwitchToIFA(new clsSwitchScheme_Client(intSwitchID).propSwitchDetailsContribution, strUserID, true, false); clsSwitchScheme_Client.updateSwitchHeader(clsSwitch.enumSwitchStatus.Approved, intSwitchID, string.Empty); clsSwitchScheme.updateSwitchHeader(intSwitchID, clsSwitch.enumSwitchStatus.Approved); int intHistoryID = clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Approved); clsSwitchScheme SwitchScheme = new clsSwitchScheme(intSwitchID); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetails, false); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetailsContribution, true); clsHistory.clsHistoryScheme.insertMessage(intHistoryID, txtDescription.Text); } else if (strButtonClick == enumButton.Resubmit.ToString()) { saveSwitch(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, txtDescription.Text, strUserID, Scheme); clsSwitchScheme_Client.updateSwitchHeader(clsSwitch.enumSwitchStatus.Proposed, intSwitchID, string.Empty); int intHistoryID = clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsSwitchScheme SwitchScheme = new clsSwitchScheme(intSwitchID); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetails, false); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetailsContribution, true); clsHistory.clsHistoryScheme.insertMessage(intHistoryID, txtDescription.Text); } else { clsSwitch.enumSwitchStatus status = (intDiscretionary == 1 || intDiscretionary == -1) ? clsSwitch.enumSwitchStatus.Approved : clsSwitch.enumSwitchStatus.Proposed; if (intSwitchID == 0) { saveSwitch(status, null, txtDescription.Text.Trim(), strUserID, Scheme); } else { saveSwitch(status, intSwitchID, txtDescription.Text.Trim(), strUserID, Scheme); } intSwitchID = new clsSwitchScheme(Scheme).propSwitchID; clsSwitchScheme SwitchScheme = new clsSwitchScheme(intSwitchID); int intHistoryID = clsHistory.clsHistoryScheme.insertHeader(strSchemeID, intSwitchID, (Int16)clsSwitch.enumSwitchStatus.Proposed); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetails, false); clsHistory.clsHistoryScheme.insertDetailsIFA(intHistoryID, SwitchScheme.propSwitchDetailsContribution, true); clsHistory.clsHistoryScheme.insertMessage(intHistoryID, txtDescription.Text); } string strMessage = clsSMS.subclsSMSTemplate.getSMSTemplate(clsSMS.subclsSMSTemplate.enumSMSTemplateID.ProposeSchemeSwitch.ToString()); strMessage = clsSMS.subclsSMSTemplate.convertSMSMessage(strMessage, null, null, null, null, Scheme); string strPopupMessage = "Message sent."; string strSMSMobileNo = txtSMSMobileNo.Text.Trim(); if (strSMSMobileNo.Length != 0) { sendSMS(strUserID, strMessage, strPopupMessage, strSMSMobileNo); } Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + strPopupMessage + "'); window.location='" + this.propBackPageURL + "';", true); }