unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) GroupBox2: TGroupBox; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label13: TLabel; Label14: TLabel; Label15: TLabel; Label16: TLabel; Label17: TLabel; Label18: TLabel; Label9: TLabel; CheckBox1: TCheckBox; CheckBox2: TCheckBox; CheckBox3: TCheckBox; CheckBox4: TCheckBox; CheckBox5: TCheckBox; Edit3: TEdit; Edit4: TEdit; Edit5: TEdit; Edit6: TEdit; Edit7: TEdit; GroupBox3: TGroupBox; Label19: TLabel; Label20: TLabel; Label21: TLabel; Label22: TLabel; Label23: TLabel; Label24: TLabel; Label25: TLabel; Label26: TLabel; Label27: TLabel; Label28: TLabel; Label29: TLabel; Label30: TLabel; Label31: TLabel; Label32: TLabel; Label33: TLabel; Label34: TLabel; Label35: TLabel; Label36: TLabel; Button2: TButton; Label3: TLabel; GroupBox1: TGroupBox; Label1: TLabel; Label2: TLabel; Edit1: TEdit; Edit2: TEdit; Button1: TButton; Panel1: TPanel; Label37: TLabel; Label38: TLabel; Button3: TButton; Label39: TLabel; Edit8: TEdit; Label40: TLabel; Label41: TLabel; Label43: TLabel; procedure FormCreate(Sender: TObject); procedure CheckBox1Click(Sender: TObject); procedure CheckBox2Click(Sender: TObject); procedure CheckBox3Click(Sender: TObject); procedure CheckBox4Click(Sender: TObject); procedure CheckBox5Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Edit3Change(Sender: TObject); procedure Edit4Change(Sender: TObject); procedure Edit5Change(Sender: TObject); procedure Edit6Change(Sender: TObject); procedure Edit7Change(Sender: TObject); procedure Label37MouseEnter(Sender: TObject); procedure Label37MouseLeave(Sender: TObject); procedure Label38MouseEnter(Sender: TObject); procedure Label38MouseLeave(Sender: TObject); procedure Label37Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Label38Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses Unit2, Unit3; {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin Edit8.Text:='0'; Label39.Caption:='Jusu turimi pinigai :'; Label39.Width:= 97; Label39.Height:= 17; Label39.Font.Size:=12; Label39.Font.Color:=clWhite; Button1.Caption:='Prisijungti'; Label40.Font.Color:=clWhite; Label40.Font.Size:=12; Label40.Caption:= 'LT'; Label41.Visible:= False; Label41.Font.Size:= 11; Label41.Font.Color:= clRed; Label41.Caption:=''; Label43.Caption:=''; Label43.Font.Color:= clGreen; Label43.Font.Size:=11; Edit1.Text:=''; Edit2.Text:=''; Label1.Caption:='Loginas :'; Label2.Caption:='Slaptazodis :'; Form1.Caption:='Parduotuve'; Label3.Caption:='Internetine parduotuve'; GroupBox1.Caption:='Prisijungti i adminstracijos panele '; Label4.Caption:='Batai Addidas'; Label5.Caption:='Batai Nike' ; Label6.Caption:='Batai Acer'; Label7.Caption:='Batai Puma'; Label8.Caption:='Batai Mike'; Label4.Width:= 121 ; Label4.Height:= 25; Label5.Width:= 121 ; Label5.Height:= 25; Label6.Width:= 121 ; Label6.Height:= 25; Label7.Width:= 121 ; Label7.Height:= 25; Label8.Width:= 121 ; Label8.Height:= 25; Label9.Caption:='250'; Label10.Caption:='220'; Label11.Caption:='230'; Label12.Caption:='400'; Label13.Caption:='140'; Label9.Height:= 25; Label9.Width:= 25 ; Label10.Height:= 25; Label10.Width:= 25 ; Label11.Height:= 25; Label11.Width:= 25 ; Label12.Height:= 25; Label12.Width:= 25 ; Label13.Width:= 25 ; Label13.Height:= 25; Label14.Caption:='LT'; Label15.Caption:='LT'; Label16.Caption:='LT'; Label17.Caption:='LT'; Label18.Caption:='LT'; Label14.Height:= 25; Label14.Width:= 17 ; Label15.Height:= 25; Label15.Width:= 17 ; Label16.Height:= 25; Label16.Width:= 17 ; Label17.Height:= 25; Label17.Width:= 17 ; Label18.Width:= 17 ; Label18.Height:= 25; Checkbox1.Caption:='Pirkti'; Checkbox2.Caption:='Pirkti'; Checkbox3.Caption:='Pirkti'; Checkbox4.Caption:='Pirkti'; Checkbox5.Caption:='Pirkti'; Edit3.Text:='0'; Edit4.Text:='0'; Edit5.Text:='0'; Edit6.Text:='0'; Edit7.Text:='0'; Label24.Caption:= 'Is viso :'; Label30.Caption:=''; Label36.Caption:=''; Checkbox1.Enabled:=False; Checkbox4.Enabled:=False; Checkbox3.Enabled:=False; Checkbox2.Enabled:=False; Checkbox5.Enabled:=False; Button2.Caption:='Skaiciuoti'; Label25.Caption:='0'; Label27.Caption:='0'; Label26.Caption:='0'; Label28.Caption:='0'; Label29.Caption:='0'; Label31.Caption:='0'; Label32.Caption:='0'; Label33.Caption:='0'; Label34.Caption:='0'; Label35.Caption:='0'; Label20.Caption:=''; Label21.Caption:=''; Label22.Caption:=''; Label23.Caption:=''; Label37.Caption:='Isjungti'; Label37.Font.Color:= clWhite; Label37.Font.Size:=10; Label38.Caption:='Apie Programa'; Label38.Font.Color:= clWhite; Label38.Font.Size:=10; Button3.Caption:='Anuliuoti Pirkima'; Button3.Enabled:=False; Button2.Enabled:=False; end; procedure TForm1.CheckBox1Click(Sender: TObject); var x , y : double ; begin Edit3.Enabled:= True; Label19.Visible:= True; Label19.Caption:= Label4.Caption ; Label25.Caption:= Edit3.Text ; Label31.Visible:= True; Label25.Visible:= True; Label31.Caption:=''; x:= StrToFloat(Edit3.Text); y:= StrtoFloat(Label9.Caption); Label31.Caption:= FloatToStr(x*y); Button3.Enabled:=True; Button2.Enabled:=True; end; procedure TForm1.CheckBox2Click(Sender: TObject); var xx , yy : double ; begin Edit4.Enabled:=True; Label20.Visible:= True; Label26.Visible:= True; Label32.Visible:= True; Label20.Caption:= Label5.Caption; Label26.Caption:= Edit4.Text; Label32.Caption:=''; xx:= StrToFloat(Label10.Caption); yy:= StrToFloat(Edit4.Text); Label32.Caption:= FloatToStr(xx*yy); Button3.Enabled:=True; Button2.Enabled:=True; end; procedure TForm1.CheckBox3Click(Sender: TObject); var xxx , yyy : double ; begin Edit5.Enabled:=True; Label21.Visible:= True; Label27.Visible:= True; Label33.Visible:= True; Label21.Caption:= Label6.caption; Label27.Caption:= Edit5.Text; Label33.Caption:=''; xxx:= StrToFloat(Label11.Caption); yyy:= StrToFloat(Edit5.Text); Label33.Caption:= FloatToStr(xxx*yyy); Button3.Enabled:=True; Button2.Enabled:=True; end; procedure TForm1.CheckBox4Click(Sender: TObject); var z , g : double ; begin Edit6.Enabled:=True; Label22.Visible:=True; Label28.Visible:=True; Label34.Visible:=True; Label22.Caption:= Label7.Caption; Label28.Caption:= Edit6.Text; Label34.Caption:=''; z:= StrToFloat(Label12.Caption); g:= StrToFloat(Edit6.Text); Label34.Caption:= FloatToStr(z*g); Button3.Enabled:=True; Button2.Enabled:=True; end; procedure TForm1.CheckBox5Click(Sender: TObject); var zz , gg : double ; begin Edit7.Enabled:=True; Label23.Visible:=True; Label29.Visible:=True; Label35.Visible:=True; Label23.Caption:= Label8.Caption; Label29.Caption:= Edit7.Text; Label35.Caption:=''; zz:= StrToFloat(label13.Caption); gg:= StrToFloat(Edit7.Text); Label35.Caption:= FloattoStr(zz*gg); Button3.Enabled:=True; Button2.Enabled:=True; end; procedure TForm1.Button1Click(Sender: TObject); begin begin if (Edit1.Text='bananas') and (Edit2.Text='konanas') then begin Form1.Visible:= False; Form2.Visible:= True; ShowMessage ('Jus Sekmingai prisijungete'); exit; end; ShowMessage ('Netisingai ivestas Login arba Slaptazodis') end; end; procedure TForm1.Edit3Change(Sender: TObject); var x, y : double ; e : string; begin Checkbox1.Enabled:=True; e:= Edit3.Text ; if (Length(e) < 1) then begin Edit3.Text:='0'; exit; end; if checkbox1.Checked then begin x:= StrToFloat(Label9.Caption); y:= StrToFloat(Edit3.Text); Label31.Caption:= FloatToStr(x*y); Label25.Caption:= FloatTOStr(y); end; end; procedure TForm1.Edit4Change(Sender: TObject); var xx, yy : double ; ee : string; begin Checkbox2.Enabled:=True; ee:= Edit4.Text ; if (Length(ee) < 1) then begin Edit4.Text:='0'; exit; end; if checkbox3.Checked then begin xx:= StrToFloat(Label10.Caption); yy:= StrToFloat(Edit4.Text); Label32.Caption:= FloatToStr(xx*yy); Label26.Caption:= FloatTOStr(yy); end; end; procedure TForm1.Edit5Change(Sender: TObject); var xxx, yyy : double ; eee : string ; begin Checkbox3.Enabled:=True; eee:= Edit5.Text ; if (Length(eee) < 1) then begin Edit5.Text:='0'; exit; end; if checkbox3.Checked then begin xxx:= StrToFloat(Label11.Caption); yyy:= StrToFloat(Edit5.Text); Label33.Caption:= FloatToStr(xxx*yyy); Label27.Caption:= FloatTOStr(yyy); end; end; procedure TForm1.Edit6Change(Sender: TObject); var xxxx, yyyy : double ; eeee : string ; begin Checkbox4.Enabled:=True; eeee:= Edit6.Text ; if (Length(eeee) < 1) then begin Edit6.Text:='0'; exit; end; if checkbox4.Checked then begin xxxx:= StrToFloat(Label12.Caption); yyyy:= StrToFloat(Edit6.Text); Label34.Caption:= FloatToStr(xxxx*yyyy); Label28.Caption:= FloatTOStr(yyyy); end; end; procedure TForm1.Edit7Change(Sender: TObject); var xxxxx, yyyyy : double ; w : string ; begin Checkbox5.Enabled:=True; w:= Edit7.Text ; if (Length(w) < 1) then begin Edit7.Text:='0'; Exit; end; if checkbox5.Checked then begin xxxxx:= StrToFloat(Label10.Caption); yyyyy:= StrToFloat(Edit7.Text); Label35.Caption:= FloatToStr(xxxxx*yyyyy); Label29.Caption:= FloatTOStr(yyyyy); end; end; procedure TForm1.Label37MouseEnter(Sender: TObject); begin Label37.Font.Color:= clSilver; Label37.Font.Size:= 10; end; procedure TForm1.Label37MouseLeave(Sender: TObject); begin Label37.Font.Color:= clWhite; end; procedure TForm1.Label38MouseEnter(Sender: TObject); begin Label38.Font.Color:= clSilver; end; procedure TForm1.Label38MouseLeave(Sender: TObject); begin Label38.Font.Color:= clWhite; end; procedure TForm1.Label37Click(Sender: TObject); begin Close; end; procedure TForm1.Button2Click(Sender: TObject); var a, b , c , d , e , f , g , h , i , j : double ; p , pp : double ; begin a:= StrToFloat(Label25.Caption); b:= StrToFloat(Label26.Caption); c:= StrToFloat(Label27.Caption); d:= StrToFloat(Label28.Caption); e:= StrToFloat(Label29.Caption); f:= StrToFloat(label31.Caption); g:= StrToFloat(Label32.Caption); h:= StrToFloat(Label33.Caption); i:= StrToFloat(Label34.Caption); j:= StrToFloat(Label35.Caption); Label30.Caption:= FloatToStr(a+b+c+d+e); Label36.Caption:= FloatToStr(f+g+h+i+j); p:= StrToFloat(Edit8.Text); pp:= f+g+h+i+j ; if p > pp then begin Label43.Visible:=True; Label43.Caption:= 'Jums lieka :' +' '+ FloatToStr(p-pp) +' ' + 'litai(u)'; exit; end; Label41.Visible:=True; Label41.Caption:= 'Jums truksta :'+ ' '+ FloatToStr(pp-p) + ' ' + 'litu'; end; procedure TForm1.Button3Click(Sender: TObject); begin Checkbox1.Enabled:=False; Checkbox2.Enabled:=False; Checkbox3.Enabled:=False; Checkbox4.Enabled:=False; Checkbox5.Enabled:=False; Checkbox1.Checked:=False; Checkbox2.Checked:=False; Checkbox3.Checked:=False; Checkbox4.Checked:=False; Checkbox5.Checked:=False; Edit3.Text:=''; Edit4.Text:=''; Edit5.Text:=''; Edit6.Text:=''; Edit7.Text:=''; Label19.Caption:=''; Label20.Caption:=''; Label21.Caption:=''; Label22.Caption:=''; Label23.Caption:=''; Label25.Caption:=''; Label26.Caption:=''; Label27.Caption:=''; Label28.Caption:=''; Label29.Caption:=''; Label30.Caption:=''; Label31.Caption:=''; Label32.Caption:=''; Label33.Caption:=''; Label34.Caption:=''; Label35.Caption:=''; Label36.Caption:=''; Label41.Visible:=False; Label43.Visible:=False; Edit8.Text:='0'; Button3.Enabled:=False; Button2.Enabled:=False; end; procedure TForm1.Label38Click(Sender: TObject); begin Form3.Visible:= True; end; end.