Example #1
0
        private void buttonUpdateCustomers_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in dataGridViewCustomers.SelectedRows)
            {
                int    id     = Convert.ToInt32(row.Cells[0].Value);
                Client client = _carService.FindCustomerById(id);

                client.Nume       = row.Cells[1].Value.ToString();
                client.Prenume    = row.Cells[2].Value.ToString();
                client.Adresa     = row.Cells[3].Value.ToString();
                client.Localitate = row.Cells[4].Value.ToString();
                client.Judet      = row.Cells[5].Value.ToString();
                client.Telefon    = row.Cells[6].Value.ToString();
                client.Email      = row.Cells[7].Value.ToString();

                _carService.UpdateClient(client);
            }

            // reload to view changes
            FormDisplayCustomers_Load(sender, e);
        }
Example #2
0
 public Client FindCustomerById(int id)
 {
     return(_api.FindCustomerById(id));
 }