private void dgvFees_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int index = dgvFees.CurrentRow.Index; Guid planAudFeeId = new Guid(dgvFees.Rows[index].Cells["PlanAuditorFeeId"].Value.ToString()); PlanAuditorFee planAudFee = new PlanAuditorFee(planAudFeeId); frmPlanAuditorFee frmPlanAuditorFee = new frmPlanAuditorFee(frmMain_Parent, planAudFee); frmPlanAuditorFee.FormClosed += frmPlanAuditorFee_FormClosed; }
private void btnDeleteFee_Click(object sender, EventArgs e) { int index = dgvFees.CurrentRow.Index; Guid planAudFeeId = new Guid(dgvFees.Rows[index].Cells["PlanAuditorFeeId"].Value.ToString()); PlanAuditorFee planAudFee = new PlanAuditorFee(planAudFeeId); DialogResult result = MessageBox.Show("Are you sure you wish to delete the selected plan Auditor fee?", "Attention", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { planAudFee.DeleteRecordFromDatabase(); LoadDgvFees(); } }
/// <summary> /// /// </summary> /// <param name="mf"></param> /// <param name="planAuditor"></param> /// <param name="Close"></param> public frmPlanAuditorFee(frmMain mf, VSP.Business.Entities.PlanAuditor planAuditor, 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(planAuditor.PlanId); Business.Entities.Auditor auditor = new Business.Entities.Auditor(planAuditor.AuditorId); DataIntegrationHub.Business.Entities.Auditor plAd = new DataIntegrationHub.Business.Entities.Auditor(auditor.AuditorId); txtAuditor.Text = plAd.Name; CurrentPlanAuditorFee = new PlanAuditorFee(); CurrentPlanAuditorFee.PlanAuditorId = planAuditor.Id; txtPlan.Text = plan.Name; CurrentTabLabel = label46; // Summary tab label highlightSelectedTabLabel(CurrentTabLabel); ss.Close(); this.Show(); }
private void LoadDgvFees() { int currentCellRow = 0; int currentCellCol = 0; if (dgvFees.CurrentCell != null) { currentCellRow = dgvFees.CurrentCell.RowIndex; currentCellCol = dgvFees.CurrentCell.ColumnIndex; } DataTable dataTable = new DataTable(); /// Set the datatable based on the SelectedIndex of <see cref="cboInvestmentViews"/>. switch (cboFeeViews.SelectedIndex) { case 0: dataTable = PlanAuditorFee.GetAssociatedActive(CurrentPlanAuditor); break; case 1: dataTable = PlanAuditorFee.GetAssociatedActive(CurrentPlanAuditor); break; default: return; } dgvFees.DataSource = dataTable; // Display/order the columns. dgvFees.Columns["PlanAuditorFeeId"].Visible = false; dgvFees.Columns["PlanAuditorId"].Visible = false; dgvFees.Columns["CreatedBy"].Visible = false; dgvFees.Columns["ModifiedBy"].Visible = false; dgvFees.Columns["StateCode"].Visible = false; // Display/order the columns. dgvFees.Columns["Notes"].Visible = false; dgvFees.Columns["Name"].DisplayIndex = 0; dgvFees.Columns["Fee"].DisplayIndex = 1; dgvFees.Columns["Benchmark25Fee"].DisplayIndex = 2; dgvFees.Columns["Benchmark25Fee"].HeaderText = "25% Benchmark"; dgvFees.Columns["Benchmark50Fee"].DisplayIndex = 3; dgvFees.Columns["Benchmark50Fee"].HeaderText = "50% Benchmark"; dgvFees.Columns["Benchmark75Fee"].DisplayIndex = 4; dgvFees.Columns["Benchmark75Fee"].HeaderText = "75% Benchmark"; dgvFees.Columns["RevenueSharingPaid"].DisplayIndex = 5; dgvFees.Columns["RevenueSharingPaid"].HeaderText = "Revenue Sharing Paid"; dgvFees.Columns["ForfeituresPaid"].DisplayIndex = 6; dgvFees.Columns["ForfeituresPaid"].HeaderText = "Forfeitures Paid"; dgvFees.Columns["ParticipantsPaid"].DisplayIndex = 7; dgvFees.Columns["ParticipantsPaid"].HeaderText = "Participants Paid"; dgvFees.Columns["PlanSponsorPaid"].DisplayIndex = 8; dgvFees.Columns["PlanSponsorPaid"].HeaderText = "Plan Sponsor Paid"; dgvFees.Columns["AsOfDate"].DisplayIndex = 9; dgvFees.Columns["ModifiedOn"].DisplayIndex = 10; dgvFees.Columns["CreatedOn"].DisplayIndex = 11; if (dgvFees.RowCount > 0 && dgvFees.ColumnCount > 0) { DataGridViewCell selectedCell = dgvFees.Rows[currentCellRow].Cells[currentCellCol]; if (selectedCell != null && selectedCell.Visible) { dgvFees.CurrentCell = selectedCell; } else { dgvFees.CurrentCell = dgvFees.FirstDisplayedCell; } } }
/// <summary> /// /// </summary> /// <param name="mf"></param> /// <param name="planAuditorFee"></param> /// <param name="Close"></param> public frmPlanAuditorFee(frmMain mf, PlanAuditorFee planAuditorFee, 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.PlanAuditor planAuditor = new Business.Entities.PlanAuditor(planAuditorFee.PlanAuditorId); Plan plan = new Plan(planAuditor.PlanId); Business.Entities.Auditor auditor = new Business.Entities.Auditor(planAuditor.AuditorId); DataIntegrationHub.Business.Entities.Auditor dihAuditor = new DataIntegrationHub.Business.Entities.Auditor(auditor.AuditorId); CurrentPlanAuditorFee = planAuditorFee; txtPlan.Text = plan.Name; txtAuditor.Text = dihAuditor.Name; txtNotes.Text = CurrentPlanAuditorFee.Notes; txtName.Text = CurrentPlanAuditorFee.Name; txtNotes.Focus(); if (CurrentPlanAuditorFee.Fee != null) { txtFee.Text = ((decimal)CurrentPlanAuditorFee.Fee).ToString("#,##"); } if (CurrentPlanAuditorFee.Benchmark25Fee != null) { txtBenchmark25Fee.Text = ((decimal)CurrentPlanAuditorFee.Benchmark25Fee).ToString("#,##"); } if (CurrentPlanAuditorFee.Benchmark50Fee != null) { txtBenchmark50Fee.Text = ((decimal)CurrentPlanAuditorFee.Benchmark50Fee).ToString("#,##"); } if (CurrentPlanAuditorFee.Benchmark75Fee != null) { txtBenchmark75Fee.Text = ((decimal)CurrentPlanAuditorFee.Benchmark75Fee).ToString("#,##"); } if (CurrentPlanAuditorFee.AsOfDate != null) { dateAsOfDate.Value = (DateTime)CurrentPlanAuditorFee.AsOfDate; dateAsOfDate.Checked = true; } else { dateAsOfDate.Checked = false; } chbxRevenueSharingPaid.Checked = CurrentPlanAuditorFee.RevenueSharingPaid; chbxForfeituresPaid.Checked = CurrentPlanAuditorFee.ForfeituresPaid; chbxParticipantsPaid.Checked = CurrentPlanAuditorFee.ParticipantsPaid; chbxPlanSponsorPaid.Checked = CurrentPlanAuditorFee.PlanSponsorPaid; CurrentTabLabel = label46; // Summary tab label highlightSelectedTabLabel(CurrentTabLabel); ss.Close(); this.Show(); }