Пример #1
0
 //Редактирование клиента, обновление данных в связанных таблицах
 private void saveClientBtn_Click(object sender, EventArgs e)
 {
     try
     {
         if (name.Text == "" || contactPerson.Text == "" || phone.Text == "" || adress.Text == "" || email.Text == "" || bankAccount.Text == "" || INN.Text == "" || country.Text == "" || city.Text == "")
         {
             MessageBox.Show("Заполните все поля!");
             return;
         }
         DBConnection.EditClient(Clients.clientID, name.Text, contactPerson.Text, phone.Text, country.SelectedValue.ToString(), city.SelectedValue.ToString(), adress.Text, email.Text, bankAccount.Text, INN.Text);
         DBConnection.GetClients();
         Clients.formDescriptor.clientsTable.DataSource = DBConnection.dtClients;
         Clients.ReadClientsTableRow(0);
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }