Пример #1
0
        private void AddAttendant_Click(object sender, EventArgs e)
        {
            this.Enabled = false;
            var addAttendantForm = new AddEditAttendantForm();

            addAttendantForm.FormClosed += (a, b) => { EmployeesForm_Load(a, b);
                                                       this.Enabled = true; };
            addAttendantForm.Show();
        }
Пример #2
0
        private void EditAttendant(int rowIndex)
        {
            Attendant attendant;
            var       d = (DataRowView)AttendantsDataGrid.Rows[rowIndex].DataBoundItem;

            using (var db = new AirlinesContext())
            {
                attendant = (Attendant)db.Employees.Find(d.Row[0]);
            }

            var editAttendantForm = new AddEditAttendantForm(attendant);

            this.Enabled = false;

            editAttendantForm.FormClosed += (a, b) => { EmployeesForm_Load(a, b);
                                                        this.Enabled = true; };
            editAttendantForm.Show();
        }