private void IndexDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { try { var employee = new LogisuiteEmployeeService.Employee() { Id = (int)IndexDataGridView.SelectedCells[0].Value, Name = IndexDataGridView.SelectedCells[1].Value.ToString(), LastName = IndexDataGridView.SelectedCells[2].Value.ToString(), DateofBirth = (DateTime)IndexDataGridView.SelectedCells[3].Value, AnnualSalary = (decimal)IndexDataGridView.SelectedCells[4].Value, Address = IndexDataGridView.SelectedCells[5].Value.ToString(), Phone = (long)IndexDataGridView.SelectedCells[6].Value, SocialSecurityNumber = (long)IndexDataGridView.SelectedCells[7].Value }; var employeeForm = new EmployeeForm(employee); employeeForm.ShowDialog(); } catch (Exception ex) { MessageBox.Show(@"Please select the whole row!!!"); } }
public EmployeeForm(LogisuiteEmployeeService.Employee employee) { InitializeComponent(); this._employee = employee; }
public EmployeeForm() { _employee = new LogisuiteEmployeeService.Employee(); InitializeComponent(); }