private void populateProposedSwitchText(enumUserLevel _userLevel) { switch (_userLevel) { case enumUserLevel.IFA: this.lblTitle_ProposedSwitch.Text = "Client Proposed Switch"; this.lblTitle_ProposedSwitchContribution.Text = "Client Proposed Contribution Allocation Switch"; break; case enumUserLevel.Client: this.lblTitle_ProposedSwitch.Text = "IFA Proposed Switch"; this.lblTitle_ProposedSwitchContribution.Text = "IFA Proposed Contribution Allocation Switch"; break; default: break; } }
private void populate(enumUserLevel _userLevel, int intSwitchID) { populateProposedSwitchText(_userLevel); populateProposedPortfolio(_userLevel, intSwitchID); }
private void populateProposedPortfolio(enumUserLevel _userLevel, int intSwitchID) { if (intSwitchID==0){return;} switch (_userLevel) { case enumUserLevel.IFA: clsSwitchScheme_Client SwitchSchemeClient = new clsSwitchScheme_Client(intSwitchID); List<clsSwitchScheme_Client.clsSwitchSchemeDetails_Client> ClientSwitchSchemeDetails = SwitchSchemeClient.propSwitchDetailsPortfolio; List<clsSwitchScheme_Client.clsSwitchSchemeDetails_Client> ClientSwitchSchemeDetailsContribution = SwitchSchemeClient.propSwitchDetailsContribution; List<clsSwitchDetailsList> listSwitchDetailsClient = clsSwitchDetailsList.convertSwitchDetails(ClientSwitchSchemeDetails); List<clsSwitchDetailsList> listSwitchDetailsClientContribution = clsSwitchDetailsList.convertSwitchDetails(ClientSwitchSchemeDetailsContribution); this.lblStatus.Text = SwitchSchemeClient.propStatusString; this.gvSwitchDetails.DataSource = listSwitchDetailsClient; this.gvSwitchDetails.DataBind(); this.gvSwitchDetailsContribution.DataSource = listSwitchDetailsClientContribution; this.gvSwitchDetailsContribution.DataBind(); Label gvSwitchFooterLblTotalAllocationClient = (Label)this.gvSwitchDetails.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocationClient.Text = ClientSwitchSchemeDetails[ClientSwitchSchemeDetails.Count - 1].propTotalAllocation.ToString("n2"); Label gvSwitchFooterLblTotalAllocationContributionClient = (Label)this.gvSwitchDetailsContribution.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocationContributionClient.Text = ClientSwitchSchemeDetailsContribution[ClientSwitchSchemeDetailsContribution.Count - 1].propTotalAllocation.ToString("n2"); this.txtProposedSwitchDesc.Text = SwitchSchemeClient.propDescription; break; case enumUserLevel.Client: clsSwitchScheme SwitchScheme = new clsSwitchScheme(intSwitchID); List<clsSwitchScheme.clsSwitchSchemeDetails> IFASwitchSchemeDetails = SwitchScheme.propSwitchDetails; List<clsSwitchScheme.clsSwitchSchemeDetails> IFASwitchSchemeDetailsContribution = SwitchScheme.propSwitchDetailsContribution; if (IFASwitchSchemeDetails == null) {break;} List<clsSwitchDetailsList> listSwitchDetails = clsSwitchDetailsList.convertSwitchDetails(IFASwitchSchemeDetails); List<clsSwitchDetailsList> listSwitchDetailsContribution = clsSwitchDetailsList.convertSwitchDetails(IFASwitchSchemeDetailsContribution); this.lblStatus.Text = SwitchScheme.propStatusString; this.gvSwitchDetails.DataSource = listSwitchDetails; this.gvSwitchDetails.DataBind(); this.gvSwitchDetailsContribution.DataSource = listSwitchDetailsContribution; this.gvSwitchDetailsContribution.DataBind(); Label gvSwitchFooterLblTotalAllocation = (Label)this.gvSwitchDetails.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocation.Text = IFASwitchSchemeDetails[IFASwitchSchemeDetails.Count - 1].propTotalAllocation.ToString("n2"); Label gvSwitchFooterLblTotalAllocationContribution = (Label)this.gvSwitchDetailsContribution.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocationContribution.Text = IFASwitchSchemeDetailsContribution[IFASwitchSchemeDetailsContribution.Count - 1].propTotalAllocation.ToString("n2"); this.txtProposedSwitchDesc.Text = SwitchScheme.propDescription; break; default: break; } }
private void populateProposedPortfolio(enumUserLevel _userLevel, int intSwitchID) { if (intSwitchID == 0) { return; } switch (_userLevel) { case enumUserLevel.IFA: clsSwitchScheme_Client SwitchSchemeClient = new clsSwitchScheme_Client(intSwitchID); List <clsSwitchScheme_Client.clsSwitchSchemeDetails_Client> ClientSwitchSchemeDetails = SwitchSchemeClient.propSwitchDetailsPortfolio; List <clsSwitchScheme_Client.clsSwitchSchemeDetails_Client> ClientSwitchSchemeDetailsContribution = SwitchSchemeClient.propSwitchDetailsContribution; List <clsSwitchDetailsList> listSwitchDetailsClient = clsSwitchDetailsList.convertSwitchDetails(ClientSwitchSchemeDetails); List <clsSwitchDetailsList> listSwitchDetailsClientContribution = clsSwitchDetailsList.convertSwitchDetails(ClientSwitchSchemeDetailsContribution); this.lblStatus.Text = SwitchSchemeClient.propStatusString; this.gvSwitchDetails.DataSource = listSwitchDetailsClient; this.gvSwitchDetails.DataBind(); this.gvSwitchDetailsContribution.DataSource = listSwitchDetailsClientContribution; this.gvSwitchDetailsContribution.DataBind(); Label gvSwitchFooterLblTotalAllocationClient = (Label)this.gvSwitchDetails.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocationClient.Text = ClientSwitchSchemeDetails[ClientSwitchSchemeDetails.Count - 1].propTotalAllocation.ToString("n2"); Label gvSwitchFooterLblTotalAllocationContributionClient = (Label)this.gvSwitchDetailsContribution.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocationContributionClient.Text = ClientSwitchSchemeDetailsContribution[ClientSwitchSchemeDetailsContribution.Count - 1].propTotalAllocation.ToString("n2"); this.txtProposedSwitchDesc.Text = SwitchSchemeClient.propDescription; break; case enumUserLevel.Client: clsSwitchScheme SwitchScheme = new clsSwitchScheme(intSwitchID); List <clsSwitchScheme.clsSwitchSchemeDetails> IFASwitchSchemeDetails = SwitchScheme.propSwitchDetails; List <clsSwitchScheme.clsSwitchSchemeDetails> IFASwitchSchemeDetailsContribution = SwitchScheme.propSwitchDetailsContribution; if (IFASwitchSchemeDetails == null) { break; } List <clsSwitchDetailsList> listSwitchDetails = clsSwitchDetailsList.convertSwitchDetails(IFASwitchSchemeDetails); List <clsSwitchDetailsList> listSwitchDetailsContribution = clsSwitchDetailsList.convertSwitchDetails(IFASwitchSchemeDetailsContribution); this.lblStatus.Text = SwitchScheme.propStatusString; this.gvSwitchDetails.DataSource = listSwitchDetails; this.gvSwitchDetails.DataBind(); this.gvSwitchDetailsContribution.DataSource = listSwitchDetailsContribution; this.gvSwitchDetailsContribution.DataBind(); Label gvSwitchFooterLblTotalAllocation = (Label)this.gvSwitchDetails.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocation.Text = IFASwitchSchemeDetails[IFASwitchSchemeDetails.Count - 1].propTotalAllocation.ToString("n2"); Label gvSwitchFooterLblTotalAllocationContribution = (Label)this.gvSwitchDetailsContribution.FooterRow.Cells[4].FindControl("gvSwitchFooterLblTotalAllocation"); gvSwitchFooterLblTotalAllocationContribution.Text = IFASwitchSchemeDetailsContribution[IFASwitchSchemeDetailsContribution.Count - 1].propTotalAllocation.ToString("n2"); this.txtProposedSwitchDesc.Text = SwitchScheme.propDescription; break; default: break; } }