Exemplo n.º 1
0
 private void button4_Click(object sender, EventArgs e)
 {
     //modify contact
     int index = dataGridView1.CurrentRow.Index;
     try
     {
         string name = dataGridView1.Rows[index].Cells[0].Value.ToString();
         int number = Convert.ToInt32(dataGridView1.Rows[index].Cells[1].Value.ToString());
         Form2 form2 = new Form2(new ContactData(name, number));
         form2.ShowDialog();
         ContactData data = new ContactData();
         data = form2.ReturnData();
         TestServiceClient client = new TestServiceClient();
         client.Open();
         client.ModifyContact(number, data.number);
         client.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }