private void viewDeductionsToolStripMenuItem_Click(object sender, EventArgs e) { string month = string.Empty; string year = string.Empty; ViewDeductions viewductions = new ViewDeductions(month, year); viewductions.MdiParent = this; viewductions.Show(); }
private void btnViewSelectedDeduction_Click(object sender, EventArgs e) { string month = string.Empty; string year = string.Empty; if (lstVwDeductionList.SelectedItems.Count > 0) { month = lstVwDeductionList.SelectedItems[0].SubItems[0].Text.ToString(); year = lstVwDeductionList.SelectedItems[0].SubItems[1].Text.ToString(); #region Date Resolution switch (month) { case "January": month = "1"; break; case "Febraury": month = "2"; break; case "March": month = "3"; break; case "April": month = "4"; break; case "May": month = "5"; break; case "June": month = "6"; break; case "July": month = "7"; break; case "August": month = "8"; break; case "September": month = "9"; break; case "October": month = "10"; break; case "November": month = "11"; break; case "December": month = "12"; break; } #endregion ViewDeductions viewDeductions = new ViewDeductions(month, year); viewDeductions.MdiParent = this.ParentForm; viewDeductions.Show(); } else { MessageBox.Show("Select a date item to view details.", "Deduction Dates", MessageBoxButtons.OK, MessageBoxIcon.Error); } }