Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="mf"></param>
        /// <param name="Close"></param>
        public frmPlanRecordKeeper(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;

            PreloadCbos();

            CurrentPlanRecordKeeper        = new PlanRecordKeeper();
            CurrentPlanRecordKeeper.PlanId = plan.PlanId;

            cboPlan.Text = plan.Name + " - " + plan.Description;

            lblMenuFees.Visible     = false;
            lblMenuServices.Visible = false;

            ss.Close();
            this.Show();
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="mf"></param>
        /// <param name="accountId"></param>
        /// <param name="Close"></param>
        public frmPlanRecordKeeperFee(frmMain mf, PlanRecordKeeper planRecordKeeper, 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(planRecordKeeper.PlanId);

            DataIntegrationHub.Business.Entities.RecordKeeper rk = new DataIntegrationHub.Business.Entities.RecordKeeper(planRecordKeeper.RecordKeeperId);

            CurrentPlanRecordKeeperFee                = new PlanRecordKeeperFee();
            CurrentPlanRecordKeeperFee.PlanId         = plan.PlanId;
            CurrentPlanRecordKeeperFee.RecordKeeperId = rk.RecordKeeperId;

            txtPlan.Text         = plan.Name;
            txtRecordKeeper.Text = rk.Name;

            ss.Close();
            this.Show();
        }
        private void dgvRKs_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int                 index               = dgvRKs.CurrentRow.Index;
            Guid                planRkId            = new Guid(dgvRKs.Rows[index].Cells["PlanRecordKeeperId"].Value.ToString());
            PlanRecordKeeper    planRK              = new PlanRecordKeeper(planRkId);
            frmPlanRecordKeeper frmPlanRecordKeeper = new frmPlanRecordKeeper(frmMain_Parent, planRK);

            frmPlanRecordKeeper.FormClosed += frmPlanRecordKeeper_FormClosed;
        }
        private void LoadDgvRks()
        {
            DataTable dataTable     = PlanRecordKeeper.GetAssociated(CurrentPlan.PlanId);
            var       dataTableEnum = dataTable.AsEnumerable();

            /// Set the datatable based on the SelectedIndex of <see cref="cboRkViews"/>.
            switch (cboRkViews.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 recordKeeperId = new Guid(dr["RecordKeeperId"].ToString());
                DataIntegrationHub.Business.Entities.RecordKeeper recordKeeper = new DataIntegrationHub.Business.Entities.RecordKeeper(recordKeeperId);
                dataTable.Rows[i]["Name"] = recordKeeper.Name;
                i++;
            }

            dgvRKs.DataSource = dataTable;

            // Display/order the columns.
            dgvRKs.Columns["PlanRecordKeeperId"].Visible = false;
            dgvRKs.Columns["RecordKeeperId"].Visible     = false;
            dgvRKs.Columns["PlanId"].Visible             = false;
            dgvRKs.Columns["CreatedBy"].Visible          = false;
            dgvRKs.Columns["CreatedOn"].Visible          = false;
            dgvRKs.Columns["ModifiedBy"].Visible         = false;
            dgvRKs.Columns["ModifiedOn"].Visible         = false;
            dgvRKs.Columns["StateCode"].Visible          = false;

            dgvRKs.Columns["Name"].DisplayIndex        = 0;
            dgvRKs.Columns["DateAdded"].DisplayIndex   = 1;
            dgvRKs.Columns["DateRemoved"].DisplayIndex = 2;
        }
Exemple #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="mf"></param>
        /// <param name="accountId"></param>
        /// <param name="Close"></param>
        public frmPlanRecordKeeper(frmMain mf, PlanRecordKeeper planRecordKeeper, 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;

            PreloadCbos();

            CurrentPlanRecordKeeper = planRecordKeeper;

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

            if (CurrentPlanRecordKeeper.RecordKeeperId != null)
            {
                DataIntegrationHub.Business.Entities.RecordKeeper recordKeeper = new DataIntegrationHub.Business.Entities.RecordKeeper(CurrentPlanRecordKeeper.RecordKeeperId);
                cboRecordKeeper.Text = recordKeeper.Name;
            }

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

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

            cboFeeViews.SelectedIndex     = 0;
            cboServicesView.SelectedIndex = 0;
            LoadDgvServices(true);

            ss.Close();
            this.Show();
        }
        private void btnDeleteRK_Click(object sender, EventArgs e)
        {
            if (dgvRKs.CurrentRow == null)
            {
                return;
            }

            int              index = dgvRKs.CurrentRow.Index;
            Guid             planRecordKeeperId = new Guid(dgvRKs.Rows[index].Cells[0].Value.ToString());
            PlanRecordKeeper planRecordKeeper   = new PlanRecordKeeper(planRecordKeeperId);

            DialogResult result = MessageBox.Show("Are you sure you wish to permanently delete the selected record keeper from the plan?", "Attention", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                planRecordKeeper.DeleteRecordFromDatabase();
                LoadDgvRks();
            }
        }