private void showhideAmendArea(bool isShow) { if (isShow) { strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); strPortfolioID = Session[clsSystem_Session.strSession.tempportfolioid.ToString()].ToString(); strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); //clsPortfolio objPortfolio = new clsPortfolio(strClientID, strPortfolioID, strUserID); clsSwitch_Client objSwitch_Client = new clsSwitch_Client((int)ViewState["intSwitchID"]); this.populateAmendSwitch(objSwitch_Client.propSwitchDetails); Session["SwitchDetails_Client"] = objSwitch_Client.propSwitchDetails; this.lblTitle_AmendSwitch.Visible = true; this.lblSwitchStatusTitle.Visible = true; this.lblSwitchStatusValue.Visible = true; } else { this.populateAmendSwitch(null); this.lblTitle_AmendSwitch.Visible = false; this.lblSwitchStatusTitle.Visible = false; this.lblSwitchStatusValue.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //Session["SourcePage"] = "portfoliodetails.asp"; //local Session["SourcePage"] = "/report/portfoliodetails.asp"; //deploy strClientID = Session[clsSystem_Session.strSession.clientID.ToString()].ToString(); strPortfolioID = Session[clsSystem_Session.strSession.tempportfolioid.ToString()].ToString(); strUserID = Session[clsSystem_Session.strSession.User.ToString()].ToString(); clsPortfolio objPortfolio = new clsPortfolio(strClientID, strPortfolioID, strUserID); if (objPortfolio.propPortfolioDetails.Count != 0) { Session["IFAPermit"] = objPortfolio.propPortfolioDetails[0].propSwitchIFAPermit; } else { Session["IFAPermit"] = false; } enableButtons((clsSwitch.enumSwitchStatus)objPortfolio.propSwitch.propStatus); showhideButtons(enumPageState.hideAll); populateHeader(objPortfolio); populateOriginalPortfolio(objPortfolio.propPortfolioDetails); populateProposedSwitch(objPortfolio.propSwitch.propSwitchDetails); showhideButtons(enumPageState.view); ViewState["intSwitchID"] = objPortfolio.propSwitch.propSwitchID; clsSwitch_Client objSwitch_Client = new clsSwitch_Client((int)ViewState["intSwitchID"]); Session["SwitchDetails_Client"] = objSwitch_Client.propSwitchDetails; if (objPortfolio.propSwitch.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)); } else if (Request["__EVENTARGUMENT"] == "AddMoreFund") { addNewFund(int.Parse(this.hfFundIDNew.Value)); } } }
private void populateSwitchDetailsClient(clsSwitch_Client oSwitchClient) { this.lblSwitchClientDescription.Text = oSwitchClient.propDescription; gvSwitchDetailsViewLabelStatusValue.Text = oSwitchClient.propStatusString; gvSwitchDetailsClient.DataSource = oSwitchClient.propSwitchDetails; gvSwitchDetailsClient.DataBind(); Label gvSwitchDetailsClientFooterLabelTotalValue = (Label)gvSwitchDetailsClient.FooterRow.Cells[3].FindControl("gvSwitchDetailsClientFooterLabelTotalValue"); gvSwitchDetailsClientFooterLabelTotalValue.Text = oSwitchClient.propSwitchDetails[oSwitchClient.propSwitchDetails.Count - 1].propTotalValue.ToString("n0"); Label gvSwitchDetailsClientFooterLabelTotalTargetAllocation = (Label)gvSwitchDetailsClient.FooterRow.Cells[4].FindControl("gvSwitchDetailsClientFooterLabelTotalTargetAllocation"); gvSwitchDetailsClientFooterLabelTotalTargetAllocation.Text = oSwitchClient.propSwitchDetails[oSwitchClient.propSwitchDetails.Count - 1].propTotalAllocation.ToString("n2"); Session["SwitchDetailsClient"] = oSwitchClient.propSwitchDetails; }
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 pageStatus(int intStatus) { switch (intStatus) { case (int)clsSwitch.enumSwitchStatus.Proposed: //disable Buttons[Save, Switch] this.btnSave.Disabled = true; this.btnSwitch.Disabled = true; canEditGridView(false); break; case (int)clsSwitch.enumSwitchStatus.Amended: //hide Buttons[Save, Switch, Cancel] for Switch Function this.divSwitch.Visible = false; //hide Buttons[Amend, Resubmit, Cancel] for Request for Discussion Function this.divRequestforDiscussion.Visible = false; // //this.lblSwitchStatusTitle.Visible = false; //this.lblSwitchStatusValue.Visible = false; //show this.divAmend.Visible = true; this.lblTitle_ProposedSwitch.Visible = true; this.lblSwitchClientDescription.Visible = true; //this.table1_container.Visible = true; this.gvSwitchDetailsClient.Visible = true; clsSwitch_Client amendClientSwitch = new clsSwitch_Client(Portfolio().propSwitch.propSwitchID); populateSwitchDetailsClient(amendClientSwitch); canEditGridView(false); break; case (int)clsSwitch.enumSwitchStatus.Request_ForDiscussion: // this.gvSwitchDetails.Visible = false; //hide Buttons[Save, Switch, Cancel] for Switch Function this.divSwitch.Visible = false; //hide Buttons[Approve, Reject] for Amend Function this.divAmend.Visible = false; // this.lblSwitchStatusTitle.Visible = false; this.lblSwitchStatusValue.Visible = false; //show this.lblTitle_ProposedSwitch.Visible = true; this.divRequestforDiscussion.Visible = true; this.lblSwitchClientDescription.Visible = true; //this.table1_container.Visible = true; this.gvSwitchDetailsClient.Visible = true; clsSwitch_Client requestClientSwitch = new clsSwitch_Client(Portfolio().propSwitch.propSwitchID); populateSwitchDetailsClient(requestClientSwitch); canEditGridView(false); break; case (int)clsSwitch.enumSwitchStatus.Approved: this.btnSave.Disabled = true; this.btnSwitch.Disabled = true; this.btnCancel.Enabled = false; canEditGridView(false); this.btnComplete.Visible = true; break; case (int)clsSwitch.enumSwitchStatus.Locked: //disable Buttons[Save, Switch, Cancel] this.btnSave.Disabled = true; this.btnSwitch.Disabled = true; this.btnCancel.Enabled = false; canEditGridView(false); break; case (int)clsSwitch.enumSwitchStatus.Declined_Client: this.btnSave.Disabled = false; this.btnSwitch.Disabled = false; this.btnCancel.Enabled = true; canEditGridView(true); break; default: break; } }
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); } }
public clsPortfolio(string strClientID , string strPortfolioID, string strUserId) { getPortfolioHeader(strClientID, strPortfolioID); this.listPortfolioDetails = getPortfolioDetails(strClientID, strPortfolioID); this.Switch = new clsSwitch(this, strUserId); this.SwitchClient = new clsSwitch_Client(propSwitch.propSwitchID); }