Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="mf"></param>
        /// <param name="accountId"></param>
        /// <param name="Close"></param>
        public frmPlanParticipantsActive(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;

            CurrentPlanParticipantsActive        = new PlanParticipantsActive();
            CurrentPlanParticipantsActive.PlanId = plan.PlanId;

            txtPlan.Text = plan.Name;

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

            ss.Close();
            this.Show();
        }
        private void dgvActiveParticipants_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int  index = dgvActiveParticipants.CurrentRow.Index;
            Guid id    = new Guid(dgvActiveParticipants.Rows[index].Cells["PlanParticipantsActiveId"].Value.ToString());
            PlanParticipantsActive    obj = new PlanParticipantsActive(id);
            frmPlanParticipantsActive frmPlanParticipantsActive = new frmPlanParticipantsActive(frmMain_Parent, obj);

            frmPlanParticipantsActive.FormClosed += frmPlanParticipantsActive_FormClosed;
        }
Exemplo n.º 3
0
    private void LoadPlanParticipantsActive(Guid planId)
    {
        DataTable dataTable = PlanParticipantsActive.GetAssociated(planId);
        List <PlanParticipantsActive> list = new List <PlanParticipantsActive>();

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

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

            int  index = dgvActiveParticipants.CurrentRow.Index;
            Guid id    = new Guid(dgvActiveParticipants.Rows[index].Cells["PlanParticipantsActiveId"].Value.ToString());
            PlanParticipantsActive obj = new PlanParticipantsActive(id);

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

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

            CurrentPlanParticipantsActive = planParticipantsActive;
            txtPlan.Text = plan.Name;

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

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

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

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