unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DBCtrls,
DB, DBTables, ComCtrls, Mask;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
DBRadioGroup1: TDBRadioGroup;
Query1: TQuery;
DBEdit1: TDBEdit;
Table1: TTable;
DataSource1: TDataSource;
DBRadioGroup2: TDBRadioGroup;
DBRadioGroup3: TDBRadioGroup;
DBRadioGroup4: TDBRadioGroup;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
DBEdit4: TDBEdit;
DBEdit5: TDBEdit;
DBEdit6: TDBEdit;
DBEdit7: TDBEdit;
DBEdit8: TDBEdit;
DBEdit9: TDBEdit;
DBEdit10: TDBEdit;
DBComboBox1: TDBComboBox;
DBComboBox2: TDBComboBox;
DBNavigator1: TDBNavigator;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
Query1: TQuery;
datum, wupb1, wupb2, wupb3, wupb4, wupb1d, wupb2d, wupb3d, wupb4d, wupb1ab, wupb2ab, wupb3ab, wupb4ab, wupgesd, wupsl, wupgt, wupel, wupges: integer;
ort,
name:
string[50];
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
//Einlesen der Variablen
wupb1 := StrToInt(DBEdit1.Text);
wupb2 := StrToInt(DBEdit2.Text);
wupb3 := StrToInt(DBEdit3.Text);
wupb4 := StrToInt(DBEdit4.Text);
wupb1d := StrToInt (DBEdit5.Text);
wupb2d := StrToInt (DBEdit6.Text);
wupb3d := StrToInt (DBEdit7.Text);
wupb4d := StrToInt (DBEdit8.Text);
//Abzüge pro Bahn
//Bahn1
case DBRadioGroup1.ItemIndex
of
0 : wupb1 := wupb1 - 1;
1 : wupb1 := wupb1 - 2;
2 : wupb1 := wupb1 - 5;
end;
//Bahn2
case DBRadioGroup2.ItemIndex
of
0 : wupb2 := wupb2 - 1;
1 : wupb2 := wupb2 - 2;
2 : wupb2 := wupb2 - 5;
end;
//Bahn3
case DBRadioGroup3.ItemIndex
of
0 : wupb3 := wupb3 - 1;
1 : wupb3 := wupb3 - 2;
2 : wupb3 := wupb3 - 5;
end;
//Bahn4
case DBRadioGroup4.ItemIndex
of
0 : wupb4 := wupb4 - 1;
1 : wupb4 := wupb4 - 2;
2 : wupb4 := wupb4 - 5;
end;
//Drops pro Bahn incl. Zuzüge
wupb1 := (wupb1d * 2) + wupb1;
wupb2 := (wupb2d * 2) + wupb2;
wupb3 := (wupb3d * 2) + wupb3;
wupb4 := (wupb4d * 2) + wupb4;
//GesamtDrops
wupgesd := wupb1d + wupb2d + wupb3d + wupb4d;
//GesamtSchläge incl. Abzüge
wupges := wupb1 + wupb2 + wupb3 + wupb4;
//Ausgabe - Gesamt Drops
DBEdit10.Text := IntToStr(wupgesd);
//Ausgabe - Gesamt Schläge incl. Zu-/Abzüge
DBEdit9.Text := IntToStr(wupges);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
table1.Open;
table1.First;
end;
procedure TForm1.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
if table1.State = dsBrowse
then
table1.Post;
table1.Close;
end;
end.