" dasturlash ii"
Download 139.04 Kb.
|
Stipendiya depo
INTERNET MANBALARI:
1. info@ususoft.uz 2.MasterSherkulov.Uz 3.Embarcadero.com ILOVA.Dasturning ko’d qismi #include #pragma hdrstop #include "Unit1.h" #include "Unit2.h" #include "Unit4.h" #include "Unit5.h" #include "Unit7.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::BitBtn1Click(TObject *Sender) { PasswordDlg->Caption="Parol menedjeri"; PasswordDlg->ShowModal(); } //--------------------------------------------------------------------------- void __fastcall TForm1::BitBtn2Click(TObject *Sender) { Form7->Caption="Haridorlar Bo'limi"; Form7->Label4->Caption=""; Form7->Show(); } //--------------------------------------------------------------------------- void __fastcall TForm1::FormActivate(TObject *Sender) { Form1->Caption="Oziq-ovqat Do'koni dasturi" ; } //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit5.h" #include "Unit2.h" #include "Unit1.h" #include "Unit4.h" #include "Unit6.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm5 *Form5; //--------------------------------------------------------------------------- __fastcall TForm5::TForm5(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm5::BitBtn1Click(TObject *Sender) { Form6->Caption="Yangi mahsulot"; DataModule4->ADOTable2->Insert(); Form6->ShowModal(); } //--------------------------------------------------------------------------- void __fastcall TForm5::BitBtn2Click(TObject *Sender) { int res=MessageDlg("Tanlangan mahsulotni o'chirmoqchimsiz ?",mtConfirmation,TMsgDlgButtons()< } else if(res< } } //--------------------------------------------------------------------------- void __fastcall TForm5::BitBtn3Click(TObject *Sender) { Form6->Caption="Tahrirlash"; Form6->ShowModal(); } //--------------------------------------------------------------------------- void __fastcall TForm5::DBGrid1DblClick(TObject *Sender) { if(Label1->Caption=="Xarajat:"){ Label1->Caption=Label1->Caption+DBText1->Caption*DBText2->Caption; } else { Label1->Caption="Xarajat:"+DBText1->Caption*DBText2->Caption; } if(Label2->Caption=="Foyda:"){ Label2->Caption=Label2->Caption+DBText1->Caption*DBText3->Caption; } else { Label2->Caption="Foyda:"+DBText1->Caption*DBText3->Caption; } if(Label3->Caption=="Umumiy:"){ Label3->Caption=Label3->Caption+IntToStr((StrToInt(DBText2->Caption)+StrToInt(DBText3->Caption))*StrToInt(DBText1->Caption)); } else { Label3->Caption="Umumiy:"+IntToStr((StrToInt(DBText2->Caption)+StrToInt(DBText3->Caption))*StrToInt(DBText1->Caption)); } } //--------------------------------------------------------------------------- void __fastcall TForm5::BitBtn4Click(TObject *Sender) { if(DBEdit1->Text.Trim()==""){ ShowMessage("Loginni kiriting !!"); DBEdit1->SetFocus(); } else if(DBEdit2->Text.Trim()==""){ ShowMessage("Parolni kiriting !!"); DBEdit2->SetFocus(); } else DataModule4->ADOTable1->Post(); DBEdit1->Visible=False; DBEdit2->Visible=False; BitBtn4->Visible=False; } //--------------------------------------------------------------------------- void __fastcall TForm5::BitBtn5Click(TObject *Sender) { if(DBEdit1->Visible==True){ DBEdit1->Visible=False; } else if(DBEdit1->Visible==False){ DBEdit1->Visible=True; } if(DBEdit2->Visible==True){ DBEdit2->Visible=False; } else if(DBEdit2->Visible==False){ DBEdit2->Visible=True; } if(BitBtn4->Visible==True){ BitBtn4->Visible=False; } else if(BitBtn4->Visible==False){ BitBtn4->Visible=True; } } //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit5.h" #include "Unit2.h" #include "Unit1.h" #include "Unit4.h" #include "Unit6.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm6 *Form6; //--------------------------------------------------------------------------- __fastcall TForm6::TForm6(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm6::BitBtn1Click(TObject *Sender) { if(Form6->Caption=="Tahrirlash"){ if(!(DBEdit1->Modified)){ Close(); }else if((DBEdit2->Modified)){ Close(); } else if(!(DBEdit3->Modified)){ Close(); }else if(!(DBEdit4->Modified)){ Close(); }if(DBEdit1->Modified){ DataModule4->ADOTable2->Post(); Close(); }else if(DBEdit2->Modified){ DataModule4->ADOTable2->Post(); Close(); } else if(DBEdit3->Modified){ DataModule4->ADOTable2->Post(); Close(); }else if(DBEdit4->Modified){ DataModule4->ADOTable2->Post(); Close(); } } if(Form6->Caption=="Yangi mahsulot"){ if(DBEdit1->Text.Trim()==""){ ShowMessage("Mahsulot nomini kiriting !!"); DBEdit1->SetFocus(); } else if(DBEdit2->Text.Trim()==""){ ShowMessage("Mahsulot kg/dona sini kiriting !!"); DBEdit2->SetFocus(); } else if(DBEdit3->Text.Trim()==""){ ShowMessage("Mahsulot narxini kiriting !!"); DBEdit3->SetFocus(); } else if(DBEdit4->Text.Trim()==""){ ShowMessage("Mahsulotga qo'shiladigan qiymatni kiriting !!"); DBEdit4->SetFocus(); } else { DataModule4->ADOTable2->Post(); Form6->Close(); } } } //--------------------------------------------------------------------------- void __fastcall TForm6::BitBtn2Click(TObject *Sender) { Form6->Close(); DataModule4->ADOTable2->Cancel(); } //--------------------------------------------------------------------------- void __fastcall TForm6::FormClose(TObject *Sender, TCloseAction &Action) { BitBtn2->Click(); } //--------------------------------------------------------------------------- void __fastcall TForm6::DBEdit1KeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if(Key==VK_RETURN){ DBEdit2->SetFocus(); } } //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- void __fastcall TForm6::DBEdit4KeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if(Key==VK_RETURN){ BitBtn1->SetFocus(); }} //--------------------------------------------------------------------------- void __fastcall TForm6::DBEdit2KeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if(Key==VK_RETURN){ DBEdit3->SetFocus(); } } //--------------------------------------------------------------------------- void __fastcall TForm6::DBEdit3KeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if(Key==VK_RETURN){ DBEdit4->SetFocus(); } } //--------------------------------------------------------------------------- void __fastcall TForm6::FormActivate(TObject *Sender) { DBEdit1->SetFocus(); } //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit1.h" #include "Unit2.h" #include "Unit4.h" #include "Unit5.h" #include "Unit7.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm7 *Form7; //--------------------------------------------------------------------------- __fastcall TForm7::TForm7(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm7::DBGrid1DblClick(TObject *Sender) { Edit1->Text=""; if(Label1->Caption=="Narxi:") { Label1->Caption=Label1->Caption+IntToStr(StrToInt(DBText1->Caption)+StrToInt(DBText2->Caption)); } else { Label1->Caption="Narxi:"+IntToStr(StrToInt(DBText1->Caption)+StrToInt(DBText2->Caption)); } Edit1->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TForm7::BitBtn1Click(TObject *Sender) { if(Label1->Caption=="Narxi:") { ShowMessage("Mahsulotni ustiga 2 marta chertib tanlang !"); DBGrid1->SetFocus(); }else if(Edit1->Text.Trim()==""){ ShowMessage("Mahsulot miqdorini kiriting !"); Edit1->SetFocus(); }else if(Label4->Caption==""){ Label4->Caption=IntToStr(StrToInt(Edit1->Text)*(StrToInt(DBText1->Caption)+StrToInt(DBText2->Caption))); Edit1->Text=""; Label1->Caption="Narxi:"; } else if(!(Label4->Caption=="")){ Label4->Caption=IntToStr(StrToInt(Label4->Caption)+StrToInt(Edit1->Text)*StrToInt(DBText1->Caption)+StrToInt(DBText2->Caption)); Edit1->Text=""; Label1->Caption="Narxi:"; } //Edit1->Text=""; //Label1->Caption="Narxi:"; } //--------------------------------------------------------------------------- void __fastcall TForm7::FormClose(TObject *Sender, TCloseAction &Action) { if(!(Label4->Caption=="")) { ShowMessage("Xaridingiz uchun raxmat :) ") ; } } //--------------------------------------------------------------------------- void __fastcall TForm7::Edit1KeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if(Key==VK_RETURN){ BitBtn1->Click(); } } //--------------------------------------------------------------------------- //--------------------------------------------------------------------- #include #pragma hdrstop #include "Unit1.h" #include "Unit2.h" #include "Unit4.h" #include "Unit5.h" //--------------------------------------------------------------------- #pragma resource "*.dfm" TPasswordDlg *PasswordDlg; //--------------------------------------------------------------------- __fastcall TPasswordDlg::TPasswordDlg(TComponent* AOwner) : TForm(AOwner) { } //--------------------------------------------------------------------- void __fastcall TPasswordDlg::FormActivate(TObject *Sender) { Edit1->Text=""; Edit2->Text=""; Edit1->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TPasswordDlg::OKBtnClick(TObject *Sender) { if(Edit1->Text==DBText1->Caption && Edit2->Text==DBText2->Caption){ Form5->Caption="Kirim-Chiqim bo'limi."; Form5->ShowModal(); PasswordDlg->Close(); } else if(!(Edit1->Text==DBText1->Caption)) { ShowMessage("login xato ? Qayta urinib ko'ring !!") ; Edit1->SetFocus(); } else if(!(Edit2->Text==DBText2->Caption)) { ShowMessage("Parol xato ? Qayta urinib ko'ring !!") ; Edit2->SetFocus(); } } //--------------------------------------------------------------------------- void __fastcall TPasswordDlg::FormClose(TObject *Sender, TCloseAction &Action) { if(Edit1->Text==""){ PasswordDlg->Activate(); }else if(Edit2->Text==""){ PasswordDlg->Activate(); } else{ PasswordDlg->Close(); } } //--------------------------------------------------------------------------- void __fastcall TPasswordDlg::Edit2KeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if(Key==VK_RETURN) { OKBtn->Click(); } } //--------------------------------------------------------------------------- void __fastcall TPasswordDlg::Edit1KeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if(Key==VK_RETURN) { Edit2->SetFocus(); }} //--------------------------------------------------------------------------- Download 139.04 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling