Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
        private void RemoveCurrentSelection()
        {
            if (SelectionsGridView.Rows.Count == 0)
            {
                CustomMessages.SelectFail(this);
                return;
            }


            int index = SelectionsGridView.CurrentCell.RowIndex,
                id    = Convert.ToInt32(SelectionsGridView["Id", index].Value);

            controller.Delete(new SubjectSelection()
            {
                Id = id
            });
            RemoveFromTableById(id);
        }