ПЗ (1218909), страница 17
Текст из файла (страница 17)
try
{
MySQLConnection.Open();//Откроем соединение с БД
MySqlCommand MySQLCommand = new MySqlCommand(sqlText, MySQLConnection);
MySQLCommand.ExecuteNonQuery();
}
catch { }
if (OperationType_comboBox.SelectedIndex == 0)
{
UpdateIntoDocs();
}
if (OperationType_comboBox.SelectedIndex == 1)
{
UpdateOutDocs();
}
}
}
private void Sales_doc_Del_button_Click(object sender, EventArgs e)
{
if (Sales_doc_listView.SelectedIndices[0] != -1)
{
string sqlText = @"DELETE FROM sales WHERE ID_sale=" + ID_sales_doc_listBox.Items[Sales_doc_listView.SelectedIndices[0]];//Текст SQL запроса
MySqlConnection MySQLConnection = new MySqlConnection(ConnectionString);//Создадим соединение
try
{
MySQLConnection.Open();//Откроем соединение с БД
MySqlCommand MySQLCommand = new MySqlCommand(sqlText, MySQLConnection);
MySQLCommand.ExecuteNonQuery();
}
catch { }
UpdateSales();
}
}
private void DemandDeletebutton_Click(object sender, EventArgs e)
{
if (DemandsFulllistView.SelectedIndices[0] != -1)
{
string sqlText = @"DELETE FROM demands WHERE ID_demand=" + DemandsFulllistView.Items[DemandsFulllistView.SelectedIndices[0]].SubItems[0].Text;//Текст SQL запроса
MySqlConnection MySQLConnection = new MySqlConnection(ConnectionString);//Создадим соединение
try
{
MySQLConnection.Open();//Откроем соединение с БД
MySqlCommand MySQLCommand = new MySqlCommand(sqlText, MySQLConnection);
MySQLCommand.ExecuteNonQuery();
}
catch { }
FullDemandsFullList();
}
}
private void button1_Click(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex != -1)
{
panel1.Visible = false;
}
}
}
}
14















