Курсовая работа: Телефонная компания
{
chosen_id=Convert::ToInt32(rdr[0]);
summ=summ_ins+Convert::ToDouble(rdr[4]);
q="update klient set bill ='"+Convert::ToString(summ)+"' where id_klient="+chosen_id+";";
cmd=gcnew System::Data::OleDb::OleDbCommand(q,cn);
rdr=cmd->ExecuteReader();
q="INSERT INTO Oplata ( Data, summ, id_klient )values (Date(),'"+Convert::ToString(summ_ins)+"','"+chosen_id+"'); ";
cmd=gcnew System::Data::OleDb::OleDbCommand(q,cn);
rdr=cmd->ExecuteReader();
}
}
rdr->Close();
q="insert into changes(id_user,data,Opisanie) values("+id+",Now(),'Внесениесуммы "+Convert::ToString(summ_ins)+" насчетклиентас ID "+chosen_id+"');";
cmd=gcnew System::Data::OleDb::OleDbCommand(q,cn);
rdr=cmd->ExecuteReader();
rdr->Close();
}
}
//действия при нажатии на кнопку "Изменить"
private: System::Void button13_Click(System::Object^ sender, System::EventArgs^ e) {
cn->Open();
if(ChoiseToLV2==1)
{
String ^q="update lg_ab SET Data='"+this->textBox10->Text+"',Srok='"+this->textBox11->Text+"',id_lgot="+Convert::ToInt32(this->textBox12->Text)+",id_klient="+Convert::ToInt32(this->textBox13->Text)+" where id_lg_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);