Esempio n. 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmAddEmployee addEmployee = new frmAddEmployee();

            if (addEmployee.ShowDialog() == DialogResult.OK)
            {
                FillGrid();
            }
        }
Esempio n. 2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            ModelEmployee modelEmployee = new ModelEmployee();

            modelEmployee.Id        = Convert.ToInt32(dgwEmployee.SelectedRows[0].Cells[0].Value);
            modelEmployee.Title     = (dgwEmployee.SelectedRows[0].Cells[1].Value).ToString();
            modelEmployee.FirstName = (dgwEmployee.SelectedRows[0].Cells[2].Value).ToString();
            modelEmployee.LastName  = (dgwEmployee.SelectedRows[0].Cells[3].Value).ToString();
            modelEmployee.Phone     = (dgwEmployee.SelectedRows[0].Cells[4].Value).ToString();
            modelEmployee.Email     = (dgwEmployee.SelectedRows[0].Cells[5].Value).ToString();
            frmAddEmployee addEmployee = new frmAddEmployee(modelEmployee);

            if (addEmployee.ShowDialog() == DialogResult.OK)
            {
                FillGrid();
            }
        }