private void ClearSchedule() { using (RessourceScheduleManager manager = new RessourceScheduleManager()) { manager.ClearScheduleForPeriod(ScheduleFromDate, ScheduleUntilDate); } }
private void ExportSchedule() { using (ExcelPackage package = new ExcelPackage()) { var worksheet = package.Workbook.Worksheets.Add("Einsatzplan"); using (RessourceScheduleManager manager = new RessourceScheduleManager()) { manager.ExportScheduleForPeriod(worksheet, ScheduleFromDate, ScheduleUntilDate); } SaveFileDialog dialog = new SaveFileDialog(); dialog.AddExtension = true; dialog.DefaultExt = "*.xlsx"; dialog.Filter = string.Format("Excel (*{0})|*{0}", "*.xlsx"); var result = dialog.ShowDialog(); if (result ?? false) { package.SaveAs(new FileInfo(dialog.FileName)); } } }