səhifə 6/6 tarix 07.01.2024 ölçüsü 119,83 Kb. #207255
Javlonbek11
Foydalanilgan adabiyotlar.
1. C++ Builder 6 справочное пособие. (A.Я. АРХАНГЕЛЬСКИЙ)
2. C va C++ tili. (Toshkent ―Voris-Nashryoti‖ 2013)
3. Самоучитель C++ Builder (Культин Н. Б.)
4. Borland C++ Builder. (О.Д.Вальпа Экспресс-курс – 2006)
5. Самоучитель программирования на языке С++ 1-qism, 2-qism
(C.Бобровский.)
ILOVA.
Form1 oynasiing ko`d qismi
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton1Click(TObject *Sender)
{
Form2->Position=Form1->Position;
Form2->Left=Form1->Left;
Form2->Top=Form1->Top;
Form2->Height=Form1->Height;
Form2->Width=Form1->Width;
Form2->ShowModal();
}
//---------------------------------------------------------------------------
Form2 oynasining ko`d qismi
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
Variant app,book,books,sheet,sheets,cell,cells;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::SpeedButton5Click(TObject *Sender)
{
app=CreateOleObject("Excel.Application");
app.OlePropertySet("Visible",true);
app.OlePropertyGet("Application").OlePropertyGet("Workbooks").OleProcedure("Add");
books=app.OlePropertyGet("Workbooks");
book=books.OlePropertyGet("Item",1);
sheets=book.OlePropertyGet("Worksheets");
sheet=sheets.OlePropertyGet("Item",1);
sheet.OlePropertySet("Name",WideString("Fast Report"));
cells=sheet.OlePropertyGet("Cells");
cell=cells.OlePropertyGet("Item",1,1);
cell.OlePropertySet("Value",WideString("ID"));
cell.OlePropertySet("ColumnWidth",WideString("10"));
cell=cells.OlePropertyGet("Item",1,2);
cell.OlePropertySet("Value",WideString("KADRNING FIO"));
cell.OlePropertySet("ColumnWidth",WideString("40"));
cell=cells.OlePropertyGet("Item",1,3);
cell.OlePropertySet("Value",WideString("TIG'ULGAN YILI"));
cell.OlePropertySet("ColumnWidth",WideString("20"));
cell=cells.OlePropertyGet("Item",1,4);
cell.OlePropertySet("Value",WideString("TUGATGAN OTM YOKI KXK"));
cell.OlePropertySet("ColumnWidth",WideString("20"));
cell=cells.OlePropertyGet("Item",1,5);
cell.OlePropertySet("Value",WideString("MUTAXASISLIGI"));
cell.OlePropertySet("ColumnWidth",WideString("20"));
ADOTable1->First();
for( int i=0;iRecordCount; i++)
{
cell=cells.OlePropertyGet("Item",i+2,1);
cell.OlePropertySet("Value",WideString(ADOTable1->FieldByName("ID")->AsWideString));
cell=cells.OlePropertyGet("Item",i+2,2);
cell.OlePropertySet("Value",WideString(ADOTable1->FieldByName("KADRNING FIO")->AsWideString));
cell=cells.OlePropertyGet("Item",i+2,3);
cell.OlePropertySet("Value",WideString(ADOTable1->FieldByName("TIG'ULGAN YILI")->AsWideString));
cell=cells.OlePropertyGet("Item",i+2,4);
cell.OlePropertySet("Value",WideString(ADOTable1->FieldByName("TUGATGAN OTM YOKI KXK")->AsWideString));
cell=cells.OlePropertyGet("Item",i+2,5);
cell.OlePropertySet("Value",WideString(ADOTable1->FieldByName("MUTAXASISLIGI")->AsWideString));
ADOTable1->Next();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm2::SpeedButton1Click(TObject *Sender)
{
ADOTable1->Insert();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::SpeedButton2Click(TObject *Sender)
{
ADOTable1->Edit();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::SpeedButton4Click(TObject *Sender)
{
switch(MessageDlg("Ma'lumotni o'chirasizmi",mtInformation,mbYesNoCancel,0))
case mrYes:ADOTable1->Delete();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::SpeedButton3Click(TObject *Sender)
{
ADOTable1->Post();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::SpeedButton6Click(TObject *Sender)
{
ADOTable1->Filtered=False;
ADOTable1->Filter="Talabaning_FIO LIKE '%"+Edit1->Text+"%'";
ADOTable1->Filtered=True;
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "Unit2.h"
#include "Unit3.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::BitBtn2Click(TObject *Sender)
{
DM->ATtalaba->Insert();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::BitBtn4Click(TObject *Sender)
{
int a,b,c,d;
a=DBEdit3->Text.ToInt();
b=DBEdit4->Text.ToInt();
c=DBEdit2->Text.ToInt();
d=a*(b-c);
DBEdit5->Text=d;
DM->ATtalaba->Post();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::BitBtn5Click(TObject *Sender)
{
DM->ATtalaba->Delete();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::BitBtn3Click(TObject *Sender)
{
DM->ATtalaba->Edit();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::BitBtn1Click(TObject *Sender)
{
TLocateOptions q;
q.Clear();
q< if (Edit1->Text=="") {
DM->ATtalaba->First();
} else
{
switch (ComboBox1->ItemIndex){
case 0: DM->ATtalaba->Locate("Mahsulot nomi",Edit1->Text,q); break;
case 1: DM->ATtalaba->Locate("Miqdori",Edit1->Text,q); break;
default:
;
}
}
}
//---------------------------------------------------------------------------
void __fastcall TForm2::BitBtn6Click(TObject *Sender)
{
Form2->Close();
Form1->Show();
}
//---------------------------------------------------------------------------Dostları ilə paylaş: