private void btnSearchEmployee_Click(object sender, EventArgs e)
        {
            if (!filledValues())
            {
                //MessageBox.Show("Complete la informaciĆ³n");
            }
            else
            {
                Cursor.Current = Cursors.WaitCursor;
                //dgvEmployee.Rows.Clear();
                serviceDAA     = new DBControllerWSClient();
                empleado       = (serviceDAA.queryEmployeeByDNI(txtDNI.Text));
                Cursor.Current = Cursors.Arrow;
                if (empleado.idEmployee != null)
                {
                    ModifyEmployeeForm modifyEmployeeForm = new ModifyEmployeeForm();
                    modifyEmployeeForm.currentEmployee = new employee();
                    //employee e1 = new employee();
                    serviceDAA = new DBControllerWSClient();
                    //e1 = serviceDAA.queryEmployeeByDNI(dgvEmployee.Rows[i].Cells[0].Value.ToString());
                    modifyEmployeeForm.currentEmployee = empleado;
                    modifyEmployeeForm.SetParent(this);
                    modifyEmployeeForm.ShowDialog();
                    updateDataGridView();
                }
                else
                {
                    MessageBox.Show("Empleado no encontrado");
                }


                //dgvEmployee.Rows.Add(new String[] {
                //empleado.dni,empleado.name,empleado.lastName,empleado.phone,empleado.email,empleado.role });
            }
        }
Example #2
0
        private void btnModifyEmployee_Click(object sender, EventArgs e)
        {
            ModifyEmployeeForm modifyEmployeeForm = new ModifyEmployeeForm();

            modifyEmployeeForm.SetParent(this);
            modifyEmployeeForm.ShowDialog();
        }
        private void btnModifyEmployee_Click(object sender, EventArgs e)
        {
            int i = dgvEmployee.CurrentCell.RowIndex;

            if (i >= 0)
            {
                ModifyEmployeeForm modifyEmployeeForm = new ModifyEmployeeForm();
                modifyEmployeeForm.currentEmployee = employees[i];
                modifyEmployeeForm.SetParent(this);
                modifyEmployeeForm.ShowDialog();
                updateDataGridView();
            }
            else
            {
                MessageBox.Show("Seleccione un empleado para modificar");
            }
        }