private void btnGenerateRep_Click(object sender, RoutedEventArgs e) { Angajat employee = (ctx.Angajats.Find(userId).IsManager == true) ? (Angajat)cmbAngajati.SelectedItem : ctx.Angajats.Find(userId); CreateDocument doc = new CreateDocument(); CreateEmployeeReport(lvEmpRep, employee); doc.EmployeeReport(lvEmpRep, employee); }
private void btnGenWeekRep_Click(object sender, RoutedEventArgs e) { ListView completedTasks = CreateWeeklyReport("completed"); ListView ongoingTasks = CreateWeeklyReport("ongoing"); ListView nextTasks = CreateWeeklyReport("nextweek"); DateTime startDate = dateStart.SelectedDate.Value; DateTime endDate = dateEnd.SelectedDate.Value; if (startDate > endDate) { MessageBox.Show("Select again the start and end dates!"); } else { CreateDocument doc = new CreateDocument(); doc.WeeklyReport(startDate.ToShortDateString() + " - " + endDate.ToShortDateString(), completedTasks, ongoingTasks, nextTasks); } }