private void GridCustomers_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { int id = Convert.ToInt32(GridCustomers.CurrentRow.Cells["IdCustomer"].Value); Customer customer = logic.GetCustomerById(id); txtId.Text = customer.IdCustomer.ToString(); txtName.Text = customer.Name.ToString(); txtAddress.Text = customer.Address.ToString(); txtPostal.Text = customer.PostalCode.ToString(); txtPhone.Text = customer.Phone.ToString(); }
public Customer GetCustomerById(int id) { GetDataLogic logic = new GetDataLogic(); return(logic.GetCustomerById(id)); }