2 Практикалық бөлім


Қосымша А Программаның листингі



бет10/10
Дата08.02.2022
өлшемі2,37 Mb.
#98824
1   2   3   4   5   6   7   8   9   10
Байланысты:
Қызметкерлердің жұмыс орнын құру

Қосымша А
Программаның листингі

#include


#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", Form1);
USEFORM("Unit2.cpp", Form2);
USEFORM("Unit3.cpp", Form3);
//---------------------------------------------------------------------------

#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::Button3Click(TObject *Sender)


{
Form1->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Form2->Show();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)


{
Form3->Show();
Form1->Hide();
}
//---------------------------------------------------------------------------

TForm2 *Form2;


//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm2::Button1Click(TObject *Sender)


{
Form1->Show();
Form2->Hide();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Edit1Change(TObject *Sender)
{
DataSource1->DataSet = ADOQuery1;
ADOQuery1->Close();
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("Select * from Base WHERE [Аты-жоні] LIKE '%"+Edit1->Text+"%'");
ADOQuery1->Open();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Edit2Change(TObject *Sender)
{
DataSource1->DataSet = ADOQuery1;
ADOQuery1->Close();
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("Select * from Base WHERE [Стаж] LIKE '%"+Edit2->Text+"%'");
ADOQuery1->Open();
}
//---------------------------------------------------------------------------

void __fastcall TForm2::ComboBox1Change(TObject *Sender)


{
DataSource1->DataSet = ADOQuery1;
ADOQuery1->Close();
ADOQuery1->SQL->Clear();
if(ComboBox1->ItemIndex == 0)
ADOQuery1->SQL->Add("Select * from Base");
else
ADOQuery1->SQL->Add("Select * from Base WHERE [Мамандыгы] LIKE '%"+ComboBox1->Text+"%'");
ADOQuery1->Open();
}
//---------------------------------------------------------------------------

void __fastcall TForm2::Button2Click(TObject *Sender)


{
if (PrintDialog1->Execute())
{ TRect SrcRect, DstRect;
Printer()->BeginDoc();
SrcRect.Top=0;
SrcRect.Left=0;
DstRect.Top=0;
DstRect.Left=0;
DstRect.Right=Printer()->PageWidth;
DstRect.Bottom=SrcRect.Bottom*((float)DstRect.Right/(float)SrcRect.Right);
Printer()->EndDoc();
}
}
//---------------------------------------------------------------------------

void __fastcall TForm2::Button3Click(TObject *Sender)


{
Form1->Close();
}
//---------------------------------------------------------------------------

TForm3 *Form3;


//---------------------------------------------------------------------------
__fastcall TForm3::TForm3(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Button1Click(TObject *Sender)
{
Form1->Show();
Form3->Hide();
}
//---------------------------------------------------------------------------




Достарыңызбен бөлісу:
1   2   3   4   5   6   7   8   9   10




©engime.org 2024
әкімшілігінің қараңыз

    Басты бет