// Pobranie danych do zapisu z bazy danych private DataTable GetDataForFile() { TextfileConstructorParams tfc_params = GetParamsFromUI(); textfileConstructor.SetParams(tfc_params); Zajecia zajecia = (Zajecia)CourseComboBox.SelectedItem; if (zajecia == null) { MessageBox.Show("Prosze wybrać zajęcia."); return(null); } else { Zajecia z = (Zajecia)CourseComboBox.SelectedItem; switch (CheckExportType()) { case ExportType.GRID: return(databaseController.Obecni_pomiedzy(conjuring, connection, zajecia, tfc_params.DateFrom, tfc_params.DateTo)); case ExportType.TABLE: var list = databaseController.GetObecnosc(conjuring, connection) .Where(o => o.Data >= tfc_params.DateFrom && o.Data <= tfc_params.DateTo) .Where(o => o.Zajecia_pojedyncze.Id_Zajec == z.Id_Zajec) .OrderBy(o => o.Data).ToList(); return(textfileConstructor.ConstructObecnoscList(list)); default: return(null); } } }
// Zebranie danych z wejść do obiektu z parametrami klasy TextfileConstructor private TextfileConstructorParams GetParamsFromUI() { TextfileConstructorParams tfc_params = new TextfileConstructorParams { SubjectName = CourseComboBox.Text, DateFrom = RaportDateFromPicker.Value, DateTo = RaportDateToPicker.Value, Late = RaportLateCheckBox.Checked, Notes = RaportNotesCheckBox.Checked }; return(tfc_params); }
public void SetParams(TextfileConstructorParams params_obj) { tfc_params = params_obj; }