1. C++ qanday dasturlash tili? C++ builder haqida ma’lumot


Download 1.83 Mb.
bet8/8
Sana02.01.2022
Hajmi1.83 Mb.
#192551
1   2   3   4   5   6   7   8
Bog'liq
2 5474343681731333285

ILOVA QISMI.

Unit 1 ni kod qismi

//---------------------------------------------------------------------------
#include

#pragma hdrstop


#include "Unit1.h"

#include "Unit2.h"

#include "Unit3.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm1 *Form1;

//---------------------------------------------------------------------------

__fastcall TForm1::TForm1(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------



void __fastcall TForm1::Button1Click(TObject *Sender)

{

String l=Edit1->Text;



String p=Edit2->Text;

ADOTable1->Filtered=false;

ADOTable1->Filter="login='"+l+"' and parol='"+p+"' ";

ADOTable1->Filtered=true;

if(ADOTable1->RecordCount==1)

{

Form2->ShowModal();



}

else


{
ShowMessage("Login:");

ShowMessage("Parol:");


Edit1->Text=""; Edit2->Text="";

Edit1->SetFocus();

}

/*if(Edit1->Text=="Admin" && Edit2->Text==12345)



{

Form2->ShowModal();

//Form1->Hide();

}

else



{

ShowMessage("ERROR");

ShowMessage("Login va parolni\n Menubardan olishiz mumkin");

}

*/



}

//---------------------------------------------------------------------------

void __fastcall TForm1::Exit1Click(TObject *Sender)

{

ShowMessage("Ushbu dastur: 651-18 guruh talabasi\n Xolmatov Shohjahon tomonidan\yaratilgan");



}

//---------------------------------------------------------------------------

void __fastcall TForm1::Exit2Click(TObject *Sender)

{

Form1->Close();



}

//---------------------------------------------------------------------------

Unit 2

//---------------------------------------------------------------------------


#include

#pragma hdrstop


#include "Unit2.h"

#include "Unit1.h"

#include "Unit3.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm2 *Form2;

//---------------------------------------------------------------------------

__fastcall TForm2::TForm2(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------



void __fastcall TForm2::Quit1Click(TObject *Sender)

{

Form2->Close();



Form1->Close();

}

//---------------------------------------------------------------------------


void __fastcall TForm2::Quit2Click(TObject *Sender)

{

Form2->Close();



Form1->Close();

}

//---------------------------------------------------------------------------



void __fastcall TForm2::BitBtn1Click(TObject *Sender)

{

ADOTable1->Insert();



Panel7->Visible=True;

}

//---------------------------------------------------------------------------


void __fastcall TForm2::BitBtn4Click(TObject *Sender)

{

float a=StrToFloat(DBEdit3->Text);



float b=StrToFloat(DBEdit4->Text);

float c=a+(a*b*0.01);

DBEdit5->Text=FloatToStr(c);

ADOTable1->Post();

Panel7->Visible=false;

}

//---------------------------------------------------------------------------


void __fastcall TForm2::BitBtn5Click(TObject *Sender)

{

ADOTable1->Cancel();



Panel7->Visible=false;

}

//---------------------------------------------------------------------------


void __fastcall TForm2::BitBtn2Click(TObject *Sender)

{

ADOTable1->Edit();



Panel7->Visible=true;
}

//---------------------------------------------------------------------------


void __fastcall TForm2::BitBtn3Click(TObject *Sender)

{

int t=MessageDlg("O'chirishni tasdiqlash",mtConfirmation,mbYesNoCancel,0);



if(t==mrYes)

{

ADOTable1->Delete();



}

}

//---------------------------------------------------------------------------


void __fastcall TForm2::Add1Click(TObject *Sender)

{

ADOTable1->Insert();



Panel7->Visible=True;

}

//---------------------------------------------------------------------------


void __fastcall TForm2::Edit1Click(TObject *Sender)

{

ADOTable1->Edit();



Panel7->Visible=true;

}

//---------------------------------------------------------------------------


void __fastcall TForm2::Delete1Click(TObject *Sender)

{

int t=MessageDlg("O'chirishni tasdiqlash",mtConfirmation,mbYesNoCancel,0);



if(t==mrYes)

{

ADOTable1->Delete();



}

}

//---------------------------------------------------------------------------


void __fastcall TForm2::Alteration1Click(TObject *Sender)

{

Form1->ADOTable1->Edit();



Form3->ShowModal();

}

//---------------------------------------------------------------------------


void __fastcall TForm2::Edit2Change(TObject *Sender)

{

if(Edit2->Text!=""){



ADOTable1->Filtered=false;

ADOTable1->Filter="Tovar_nomi like '%"+Edit2->Text+"%'";

ADOTable1->Filtered=true;}

else


{

ADOTable1->Filtered=false;

}

}

//---------------------------------------------------------------------------


void __fastcall TForm2::Timer1Timer(TObject *Sender)

{

/*Label6->Left+=5;



if(Label6->Left==579)

{

Timer1->Enabled=false;



}

/*

if(Label6->Left!=579)



{

Label6->Left+=5;

}

Timer1->Enabled=false;



Timer2->Enabled=true;*/

}

//---------------------------------------------------------------------------


void __fastcall TForm2::Timer2Timer(TObject *Sender)

{

/*if(Label6->Left!=0)



{

Label6->Left-=5;

}

Timer1->Enabled=false;



Timer2->Enabled=true;

*/

}



//---------------------------------------------------------------------------

void __fastcall TForm2::SpeedButton1Click(TObject *Sender)

{

if(Edit2->Text!=""){



ADOTable1->Filtered=false;

ADOTable1->Filter="Tovar_nomi like '%"+Edit2->Text+"%'";

ADOTable1->Filtered=true;}

else


{

ADOTable1->Filtered=false;

}

}

//---------------------------------------------------------------------------


void __fastcall TForm2::Program1Click(TObject *Sender)

{

ShowMessage("Designed by Xolmatov Shohjahon")



;}

//---------------------------------------------------------------------------


Unit 3

//---------------------------------------------------------------------------


#include

#pragma hdrstop


#include "Unit3.h"

#include "Unit2.h"

#include "Unit1.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)

#pragma resource "*.dfm"

TForm3 *Form3;

//---------------------------------------------------------------------------

__fastcall TForm3::TForm3(TComponent* Owner)

: TForm(Owner)

{

}

//---------------------------------------------------------------------------



void __fastcall TForm3::BitBtn2Click(TObject *Sender)

{

Form1->ADOTable1->Cancel();



Form3->Close();

}

//---------------------------------------------------------------------------



void __fastcall TForm3::BitBtn1Click(TObject *Sender)

{

Form1->ADOTable1->Post();



Form2->Close();

Form3->Close();



}

//---------------------------------------------------------------------------
Download 1.83 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling