public PresenterAdmin() { this.edbm = new EmployeeDBManager(); FormA = new FormAdmin(); FormA.buttonView.Click += new System.EventHandler(setDataGrid); FormA.c.Click += new System.EventHandler(addEmployee); FormA.button1.Click += new System.EventHandler(updateEmployee); FormA.button2.Click += new System.EventHandler(deleteEmployee); FormA.Show(); }
private void buttonReport_Click(object sender, EventArgs e) { EmployeeDBManager edbm = new EmployeeDBManager(); DateTime start = textBoxStartDate.Value; DateTime end = textBoxEndDate.Value; int id = Convert.ToInt32(textBoxEmplID.Text); IList <EmployeeActivity> emplActivityList = edbm.RetrieveEmployeeActivity(id, start, end); if (emplActivityList.Count > 0) { string message = edbm.generateReport(emplActivityList); MessageBox.Show(message); } else { MessageBox.Show("No activity for this user"); } }