Example #1
0
        private void NewButton_Click(object sender, EventArgs e)
        {
            EmployeeForm form = new EmployeeForm();

            form.FormClosed += new FormClosedEventHandler(this.OnFormClose);
            form.Show();
        }
Example #2
0
        private void editButton_Click(object sender, EventArgs e)
        {
            int index = employeesGrid.SelectedCells.Count > 0 ? employeesGrid.SelectedCells[0].RowIndex : -1;

            index = index != -1 ? Int32.Parse(employeesGrid.Rows[index].Cells[0].Value.ToString()) : 0;
            EmployeeForm form = new EmployeeForm(index);

            form.FormClosed += new FormClosedEventHandler(this.OnFormClose);
            form.Show();
        }