/// <summary>
        ///
        /// </summary>
        /// <param name="mf"></param>
        /// <param name="accountId"></param>
        /// <param name="Close"></param>
        public frmAdvisor(frmMain mf, VSP.Business.Entities.Advisor planAdvisor, FormClosedEventHandler Close = null)
        {
            frmSplashScreen ss = new frmSplashScreen();

            ss.Show();
            Application.DoEvents();

            InitializeComponent();

            frmMain_Parent = mf;

            this.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size;

            Application.AddMessageFilter(this);
            controlsToMove.Add(this.pnlSummaryTabHeader);
            controlsToMove.Add(this.panel16);
            controlsToMove.Add(this.label1);
            controlsToMove.Add(this.label23);

            FormClosed += Close;

            DataIntegrationHub.Business.Entities.PlanAdvisor dihPA = new DataIntegrationHub.Business.Entities.PlanAdvisor(planAdvisor.Id);

            CurrentPlanAdvisor = planAdvisor;
            txtName.Text       = dihPA.Name;

            cboServicesView.SelectedIndex = 0;
            LoadDgvServices(true);

            ss.Close();
            this.Show();
        }
        private void LoadDgvAdvisors()
        {
            DataTable dataTable     = VSP.Business.Entities.PlanAdvisor.GetAssociated(CurrentPlan.PlanId);
            var       dataTableEnum = dataTable.AsEnumerable();

            /// Set the datatable based on the SelectedIndex of <see cref="cboRkViews"/>.
            switch (cboAdvisorViews.SelectedIndex)
            {
            case 0:
                dataTableEnum = dataTableEnum.Where(x => x.Field <int>("StateCode") == 0);
                break;

            case 1:
                dataTableEnum = dataTableEnum.Where(x => x.Field <int>("StateCode") == 1);
                break;

            default:
                return;
            }

            if (dataTableEnum.Any())
            {
                dataTable = dataTableEnum.CopyToDataTable();
            }
            else
            {
                dataTable.Rows.Clear();
            }

            dataTable.Columns.Add("Name");

            int i = 0;

            foreach (DataRow dr in dataTable.Rows)
            {
                Guid advisorId = new Guid(dr["AdvisorId"].ToString());
                DataIntegrationHub.Business.Entities.PlanAdvisor advisor = new DataIntegrationHub.Business.Entities.PlanAdvisor(advisorId);
                dataTable.Rows[i]["Name"] = advisor.Name;
                i++;
            }

            dgvAdvisors.DataSource = dataTable;

            // Display/order the columns.
            dgvAdvisors.Columns["PlanAdvisorId"].Visible = false;
            dgvAdvisors.Columns["AdvisorId"].Visible     = false;
            dgvAdvisors.Columns["PlanId"].Visible        = false;
            dgvAdvisors.Columns["CreatedBy"].Visible     = false;
            dgvAdvisors.Columns["CreatedOn"].Visible     = false;
            dgvAdvisors.Columns["ModifiedBy"].Visible    = false;
            dgvAdvisors.Columns["ModifiedOn"].Visible    = false;
            dgvAdvisors.Columns["StateCode"].Visible     = false;

            dgvAdvisors.Columns["Name"].DisplayIndex        = 0;
            dgvAdvisors.Columns["DateAdded"].DisplayIndex   = 1;
            dgvAdvisors.Columns["DateRemoved"].DisplayIndex = 2;
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="mf"></param>
        /// <param name="accountId"></param>
        /// <param name="Close"></param>
        public frmPlanAdvisor(frmMain mf, VSP.Business.Entities.PlanAdvisor planAdvisor, FormClosedEventHandler Close = null)
        {
            frmSplashScreen ss = new frmSplashScreen();

            ss.Show();
            Application.DoEvents();

            InitializeComponent();

            frmMain_Parent = mf;

            this.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size;

            Application.AddMessageFilter(this);
            controlsToMove.Add(this.pnlSummaryTabHeader);
            controlsToMove.Add(this.panel16);
            controlsToMove.Add(this.label1);
            controlsToMove.Add(this.label23);

            FormClosed += Close;

            CurrentPlanAdvisor = planAdvisor;

            cboFeeViews.SelectedIndex = 0;
            PreloadCbos();

            if (CurrentPlanAdvisor.PlanId != null)
            {
                Plan plan = new Plan(CurrentPlanAdvisor.PlanId);
                cboPlan.Text = plan.Name + " - " + plan.Description;
            }

            if (CurrentPlanAdvisor.AdvisorId != null)
            {
                DataIntegrationHub.Business.Entities.PlanAdvisor advisor = new DataIntegrationHub.Business.Entities.PlanAdvisor(CurrentPlanAdvisor.AdvisorId);
                cboAdvisor.Text = advisor.Name;
            }

            if (CurrentPlanAdvisor.DateAdded != null)
            {
                txtDateAdded.Text = ((DateTime)CurrentPlanAdvisor.DateAdded).ToString("MM/dd/yyyy");
            }

            if (CurrentPlanAdvisor.DateRemoved != null)
            {
                txtDateRemoved.Text = ((DateTime)CurrentPlanAdvisor.DateRemoved).ToString("MM/dd/yyyy");
            }

            cboFeeViews.SelectedIndex = 0;

            CurrentTabLabel = label46; // Summary tab label
            highlightSelectedTabLabel(CurrentTabLabel);

            ss.Close();
            this.Show();
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="mf"></param>
        /// <param name="planAdvisor"></param>
        /// <param name="Close"></param>
        public frmPlanAdvisorFee(frmMain mf, VSP.Business.Entities.PlanAdvisor planAdvisor, FormClosedEventHandler Close = null)
        {
            frmSplashScreen ss = new frmSplashScreen();

            ss.Show();
            Application.DoEvents();

            InitializeComponent();

            frmMain_Parent = mf;

            this.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size;

            Application.AddMessageFilter(this);
            controlsToMove.Add(this.pnlSummaryTabHeader);
            controlsToMove.Add(this.panel16);
            controlsToMove.Add(this.label1);
            controlsToMove.Add(this.label23);

            FormClosed += Close;

            Plan    plan    = new Plan(planAdvisor.PlanId);
            Advisor advisor = new Advisor(planAdvisor.AdvisorId);

            DataIntegrationHub.Business.Entities.PlanAdvisor plAd = new DataIntegrationHub.Business.Entities.PlanAdvisor(planAdvisor.AdvisorId);
            txtAdvisor.Text = plAd.Name;

            CurrentPlanAdvisorFee = new PlanAdvisorFee();
            CurrentPlanAdvisorFee.PlanAdvisorId = planAdvisor.Id;

            txtPlan.Text = plan.Name;

            CurrentTabLabel = label46; // Summary tab label
            highlightSelectedTabLabel(CurrentTabLabel);

            ss.Close();
            this.Show();
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="mf"></param>
        /// <param name="planAdvisorFee"></param>
        /// <param name="Close"></param>
        public frmPlanAdvisorFee(frmMain mf, PlanAdvisorFee planAdvisorFee, FormClosedEventHandler Close = null)
        {
            frmSplashScreen ss = new frmSplashScreen();

            ss.Show();
            Application.DoEvents();

            InitializeComponent();

            frmMain_Parent = mf;

            this.MaximumSize = Screen.PrimaryScreen.WorkingArea.Size;

            Application.AddMessageFilter(this);
            controlsToMove.Add(this.pnlSummaryTabHeader);
            controlsToMove.Add(this.panel16);
            controlsToMove.Add(this.label1);
            controlsToMove.Add(this.label23);

            FormClosed += Close;

            Business.Entities.PlanAdvisor planAdvisor = new Business.Entities.PlanAdvisor(planAdvisorFee.PlanAdvisorId);
            Plan    plan    = new Plan(planAdvisor.PlanId);
            Advisor advisor = new Advisor(planAdvisor.AdvisorId);

            DataIntegrationHub.Business.Entities.PlanAdvisor dihPlanAdvisor = new DataIntegrationHub.Business.Entities.PlanAdvisor(advisor.Id);

            CurrentPlanAdvisorFee = planAdvisorFee;
            txtPlan.Text          = plan.Name;
            txtAdvisor.Text       = dihPlanAdvisor.Name;
            txtNotes.Text         = CurrentPlanAdvisorFee.Notes;
            txtName.Text          = CurrentPlanAdvisorFee.Name;

            txtNotes.Focus();

            if (CurrentPlanAdvisorFee.Fee != null)
            {
                txtFee.Text = ((decimal)CurrentPlanAdvisorFee.Fee).ToString("#,##");
            }

            if (CurrentPlanAdvisorFee.Benchmark25Fee != null)
            {
                txtBenchmark25Fee.Text = ((decimal)CurrentPlanAdvisorFee.Benchmark25Fee).ToString("#,##");
            }

            if (CurrentPlanAdvisorFee.Benchmark50Fee != null)
            {
                txtBenchmark50Fee.Text = ((decimal)CurrentPlanAdvisorFee.Benchmark50Fee).ToString("#,##");
            }

            if (CurrentPlanAdvisorFee.Benchmark75Fee != null)
            {
                txtBenchmark75Fee.Text = ((decimal)CurrentPlanAdvisorFee.Benchmark75Fee).ToString("#,##");
            }

            if (CurrentPlanAdvisorFee.AsOfDate != null)
            {
                dateAsOfDate.Value   = (DateTime)CurrentPlanAdvisorFee.AsOfDate;
                dateAsOfDate.Checked = true;
            }
            else
            {
                dateAsOfDate.Checked = false;
            }

            chbxRevenueSharingPaid.Checked = CurrentPlanAdvisorFee.RevenueSharingPaid;
            chbxForfeituresPaid.Checked    = CurrentPlanAdvisorFee.ForfeituresPaid;
            chbxParticipantsPaid.Checked   = CurrentPlanAdvisorFee.ParticipantsPaid;
            chbxPlanSponsorPaid.Checked    = CurrentPlanAdvisorFee.PlanSponsorPaid;

            CurrentTabLabel = label46; // Summary tab label
            highlightSelectedTabLabel(CurrentTabLabel);

            ss.Close();
            this.Show();
        }