/// <summary>
        ///
        /// </summary>
        /// <param name="mf"></param>
        /// <param name="accountId"></param>
        /// <param name="Close"></param>
        public frmPlanParticipantsEligible(frmMain mf, Plan plan, 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;

            CurrentPlanParticipantsEligible        = new PlanParticipantsEligible();
            CurrentPlanParticipantsEligible.PlanId = plan.PlanId;

            txtPlan.Text = plan.Name;

            ss.Close();
            this.Show();
        }
        private void dgvEligibleParticipants_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int  index = dgvEligibleParticipants.CurrentRow.Index;
            Guid id    = new Guid(dgvEligibleParticipants.Rows[index].Cells["PlanParticipantsEligibleId"].Value.ToString());
            PlanParticipantsEligible    obj = new PlanParticipantsEligible(id);
            frmPlanParticipantsEligible frmPlanParticipantsEligible = new frmPlanParticipantsEligible(frmMain_Parent, obj);

            frmPlanParticipantsEligible.FormClosed += frmPlanParticipantsEligible_FormClosed;
        }
Ejemplo n.º 3
0
    private void LoadPlanParticipantsEligible(Guid planId)
    {
        DataTable dataTable = PlanParticipantsEligible.GetAssociated(planId);
        List <PlanParticipantsEligible> list = new List <PlanParticipantsEligible>();

        foreach (DataRow dr in dataTable.Rows)
        {
            var id  = new Guid(dr["PlanParticipantsEligibleId"].ToString());
            var obj = new PlanParticipantsEligible(id);
            list.Add(obj);
        }

        if (list.Count > 0)
        {
            PlanParticipantsEligible = list.OrderByDescending(x => x.AsOfDate).First();
        }
    }
        private void btnDeleteEligibleParticipants_Click(object sender, EventArgs e)
        {
            if (dgvEligibleParticipants.CurrentRow == null)
            {
                return;
            }

            int  index = dgvEligibleParticipants.CurrentRow.Index;
            Guid id    = new Guid(dgvEligibleParticipants.Rows[index].Cells["PlanParticipantsEligibleId"].Value.ToString());
            PlanParticipantsEligible obj = new PlanParticipantsEligible(id);

            DialogResult result = MessageBox.Show("Are you sure you wish to delete eligible plan participants on " + obj.AsOfDate.ToString("MM/dd/yyyy") + "?", "Attention", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                obj.DeleteRecordFromDatabase();
                LoadDgvEligibleParticipants();
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="mf"></param>
        /// <param name="accountId"></param>
        /// <param name="Close"></param>
        public frmPlanParticipantsEligible(frmMain mf, PlanParticipantsEligible PlanParticipantsEligible, 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(PlanParticipantsEligible.PlanId);

            CurrentPlanParticipantsEligible = PlanParticipantsEligible;
            txtPlan.Text = plan.Name;

            if (CurrentPlanParticipantsEligible.ParticipantCount != null)
            {
                txtParticipantCount.Text = ((decimal)CurrentPlanParticipantsEligible.ParticipantCount).ToString("#,##");
            }

            if (CurrentPlanParticipantsEligible.AsOfDate != null)
            {
                txtAsOfDate.Text = ((DateTime)CurrentPlanParticipantsEligible.AsOfDate).ToString("MM/dd/yyyy");
            }

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

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