private void SelectionDeclineButton_Click(object sender, EventArgs e) { if (New) //reset { //reset SetSelection(new SubjectSelection()); //reset all lecturers for (int i = 0; i < LecturersGridView.Rows.Count; ++i) { if (LecturersGridView["Select", i].Value != null && (bool)LecturersGridView["Select", i].Value) { LecturersGridView["Select", i].Value = false; } } checked_lecturers_id.Clear(); TimetableControl.ResetLectureTimes(); } else if (CustomMessages.YesNoDelete(this)) { Deleted = controller.Delete(selection); Close(); } }
private void UpdateTimetable() { TimetableControl.Update(); _subjects[LvSubjects.SelectedIndex] = TimetableControl.Model; LvSubjects.Items.Refresh(); _changed = true; }
private void OkayButton_Click(object sender, EventArgs e) { preferred_times = TimetableControl.GetLectureTimes(TimetableControl.IsPreferredCell); denied_times = TimetableControl.GetLectureTimes(TimetableControl.IsDeniedCell); if (preferred_times.Count > 0 || denied_times.Count > 0) { CustomMessages.OptionsSaved(this); } Hide(); }
private void timetablesMenuButton_Click(object sender, EventArgs e) { mainPanel.Controls.Clear(); TimetableControl timetableControl = new TimetableControl { Dock = DockStyle.Fill }; mainPanel.Controls.Add(timetableControl); UnderlineMenuButton(timetablesMenuButton); }
public void SetSelection(SubjectSelection selection) { this.selection = selection; deep_copy = new SubjectSelection(selection); New = (selection.Id == 0); //BindData(); SubjectCombobox.SelectedValue = selection.SubjectId; HallCombobox.SelectedValue = selection.HallId; TimetableControl.AddSubjectAndTimes( selection.Subject, selection.Times); }
private void SelectionAcceptButton_Click(object sender, EventArgs e) { if (SubjectCombobox.SelectedIndex == -1 || HallCombobox.SelectedIndex == -1) { CustomMessages.ChooseBeforeCarryOn(this, "subject and hall"); return; } if (New) { //databinding by hand selection.HallId = Convert.ToInt32(HallCombobox.SelectedValue); selection.SubjectId = Convert.ToInt32(SubjectCombobox.SelectedValue); int selection_id = (int)controller.Insert(selection); selection.Id = selection_id; if (selection_id > 0) { selection_time_controller.InsertTimes(selection_id, TimetableControl.GetLectureTimes(TimetableControl.IsSelectedCell)); selection_lecturer_controller.InsertLecturers(selection_id, checked_lecturers_id.ToList()); CustomMessages.Inserted(this, "selection"); InsertedSelections.Add(selection); SetAfterInsert(); } } else { //quite the horrible way as I delete everything and re-insert them if (controller.Update(selection)) { selection_time_controller.DeleteBySelection(selection.Id); selection_lecturer_controller.DeleteBySelection(selection.Id); selection_time_controller.InsertTimes(selection.Id, TimetableControl.GetLectureTimes(TimetableControl.IsSelectedCell)); selection_lecturer_controller.InsertLecturers(selection.Id, checked_lecturers_id.ToList()); SetSelection(selection); CustomMessages.Updated(this, "selection"); //TimetableControl.ResetLectureTimes(); Updated = true; } } }
private void SelectionApplyButton_Click(object sender, EventArgs e) { TimetableControl.ResetLectureTimes(); TimetableControl.AddSubjectToSelectedCells((Subject)SubjectCombobox.SelectedItem); }
private void SetAfterInsert() { deep_copy = new SubjectSelection(selection); selection = new SubjectSelection(); TimetableControl.ResetLectureTimes(); }
private void ResetButton_Click(object sender, EventArgs e) { TimetableControl.ResetLectureTimes(); }
private void resetSelectedTimesToolStripMenuItem_Click(object sender, EventArgs e) { TimetableControl.ResetSelectedTimes(); }
private void resetAllToolStripMenuItem_Click(object sender, EventArgs e) { TimetableControl.ResetLectureTimes(); }
private void addDeniedTimesToolStripMenuItem_Click(object sender, EventArgs e) { TimetableControl.SetDeniedLectureTimes(); }