//Добавление новой заявки в БД, обновление данных в связанных таблицах private void addRequestBtn_Click(object sender, EventArgs e) { try { if (client.Text == "" || manager.Text == "") { MessageBox.Show("Заполните все поля!"); return; } loadingPanel.Visible = true; this.Enabled = false; Form1.form.Enabled = false; DBConnection.NewRequest(client.SelectedValue.ToString(), manager.SelectedValue.ToString(), dateCreate.Value.ToString("yyyy-MM-dd"), status.Text); DBConnection.GetRequests(); Form1.form.requestsAndContractsTable.DataSource = DBConnection.dtRequests; Form1.form.PaintGrid(); Form1.ReadRequestsTableRow(0); Form1.form.newContractBtn.Enabled = true; Form1.form.UpdateRelatedData(0); loadingPanel.Visible = false; Form1.form.Enabled = true; this.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }