Курсовая работа: Телефонная компания
rdr->Close();
}
if(ChoiseToLV2==4)
{
String ^q="update ys_ab SET Data='"+this->textBox10->Text+"',Srok='"+this->textBox11->Text+"',id_service="+Convert::ToInt32(this->textBox12->Text)+",id_klient="+Convert::ToInt32(this->textBox13->Text)+" where id_ys_ab="+Convert::ToInt32(this->textBox9->Text);
System::Data::OleDb::OleDbCommand ^cmd=gcnew System::Data::OleDb::OleDbCommand(q,cn);
System::Data::OleDb::OleDbDataReader ^rdr=cmd->ExecuteReader();
rdr->Close();
q="insert into changes(id_user,data,Opisanie) values("+id+",Now(),'Изменениезаписивтаблицеклиент-услугас ID "+Convert::ToInt32(this->textBox9->Text)+"');";
cmd=gcnew System::Data::OleDb::OleDbCommand(q,cn);
rdr=cmd->ExecuteReader();
rdr->Close();
}
cn->Close();
}
//действия при нажатии на кнопку "Удалить"
private: System::Void button14_Click(System::Object^ sender, System::EventArgs^ e) {
cn->Open();
System::Data::OleDb::OleDbCommand ^cmd;
System::Data::OleDb::OleDbDataReader ^rdr;
if(ChoiseToLV2==1)
{
String ^q="delete from lg_ab where id_lg_ab="+Convert::ToInt32(this->textBox9->Text);
cmd=gcnew System::Data::OleDb::OleDbCommand(q,cn);
rdr=cmd->ExecuteReader();
q="insert into changes(id_user,data,Opisanie) values("+id+",Now(),'Удалениезаписивтаблицеклиент-льготас ID "+Convert::ToInt32(this->textBox9->Text)+"');";
cmd=gcnew System::Data::OleDb::OleDbCommand(q,cn);
rdr=cmd->ExecuteReader();
rdr->Close();