unit Main;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, Menus, ComCtrls,
DB, Grids,
DBGrids, dbf, DBTables, XPMan, jpeg, ToolWin, RpRender, RpRenderPDF,
RpDefine, RpRave, RpCon, RpConDS, ImgList, FMTBcd, SqlExpr;
type
TMainForm =
class(TForm)
MainMenu: TMainMenu;
FileExitItem: TMenuItem;
EditUndoItem: TMenuItem;
EditCutItem: TMenuItem;
EditCopyItem: TMenuItem;
EditPasteItem: TMenuItem;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Edit3: TEdit;
Button1: TButton;
Dbf1: TDbf;
XPManifest1: TXPManifest;
Edit4: TEdit;
Button4: TButton;
GroupBox1: TGroupBox;
Label3: TLabel;
Label4: TLabel;
vonGast: TEdit;
bisGast: TEdit;
Button2: TButton;
GroupBox2: TGroupBox;
Label5: TLabel;
Label6: TLabel;
Timer1: TTimer;
StatusBar1: TStatusBar;
OpenDialog1: TOpenDialog;
Oeffnen1: TMenuItem;
RvRenderPDF1: TRvRenderPDF;
RvDataSetConnection1: TRvDataSetConnection;
RvCustomConnection1: TRvCustomConnection;
RvProject1: TRvProject;
Drucken1: TMenuItem;
PrintDialog1: TPrintDialog;
Dbf1KUNR: TIntegerField;
Dbf1KUNAM: TStringField;
Dbf1KUANRED: TStringField;
Dbf1KUFIRMA: TStringField;
Dbf1KUSALDO: TFloatField;
Dbf1KULIMIT: TLargeintField;
ImageList1: TImageList;
Query1: TQuery;
procedure FormCreate(Sender: TObject);
procedure FileExit(Sender: TObject);
procedure EditUndo(Sender: TObject);
procedure EditCut(Sender: TObject);
procedure EditCopy(Sender: TObject);
procedure EditPaste(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Oeffnen1Click(Sender: TObject);
procedure Drucken1Click(Sender: TObject);
procedure Edit3KeyPress(Sender: TObject;
var Key: Char);
procedure vonGastChange(Sender: TObject);
procedure Edit3Change(Sender: TObject);
procedure Button2Click(Sender: TObject);
end;
var
MainForm: TMainForm;
implementation
{$r *.dfm}
procedure TMainForm.FormCreate(Sender: TObject);
begin
Statusbar1.Panels[1].Text:=TimeToStr (now);
Statusbar1.Panels[2].Text:=DateToStr (now);
end;
procedure TMainForm.FileExit(Sender: TObject);
begin
dbf1.active := false;
dbf1.Close;
application.Terminate;
end;
procedure TMainForm.EditUndo(Sender: TObject);
begin
{ Code zur Durchführung von Bearbeiten Rückgängig hinzufügen }
end;
procedure TMainForm.EditCut(Sender: TObject);
begin
{ Code zur Durchführung von Bearbeiten Ausschneiden hinzufügen }
end;
procedure TMainForm.EditCopy(Sender: TObject);
begin
{ Code zur Durchführung von Bearbeiten Kopieren hinzufügen }
end;
procedure TMainForm.EditPaste(Sender: TObject);
begin
{ Code zur Durchführung von Bearbeiten Einfügen hinzufügen }
end;
procedure TMainForm.Button1Click(Sender: TObject);
begin
dbf1.First;
while not dbf1.EoF
do begin
dbf1.Edit;
dbf1.FieldByName('
KULimit').AsString := edit3.Text;
dbf1.Post;
dbf1.Next;
end;
end;
procedure TMainForm.Button4Click(Sender: TObject);
begin
dbf1.First;
while not dbf1.EoF
do begin
dbf1.Edit;
dbf1.FieldByName('
KULimit').AsString := edit4.Text;
dbf1.Post;
dbf1.Next;
end;
end;
procedure TMainForm.Timer1Timer(Sender: TObject);
begin
Statusbar1.Panels[1].Text:=DateToStr (now);
Statusbar1.Panels[2].Text:=TimeToStr (now);
end;
procedure TMainForm.Oeffnen1Click(Sender: TObject);
begin
dbf1.active := false;
DataSource1.DataSet := dbf1;
OpenDialog1.execute;
dbf1.active := true;
end;
procedure TMainForm.Drucken1Click(Sender: TObject);
begin
RvProject1.Open;
RvProject1.Execute;
end;
procedure TMainForm.Edit3KeyPress(Sender: TObject;
var Key: Char);
begin
if NOT (Key
in [#08, '
0'..'
9'])
then
Key := #0;
end;
procedure TMainForm.vonGastChange(Sender: TObject);
//Filter Button wird eingeschaltet
begin
button2.Enabled:=true;
end;
procedure TMainForm.Edit3Change(Sender: TObject);
//OK Button wird eingeschaltet
begin
button1.Enabled:=true;
end;
procedure TMainForm.Button2Click(Sender: TObject);
begin
query1.Close;
query1.sql.text := '
select * from Kunden limit ' + vonGast.Text + '
, ' + bisGast.Text;
query1.Open;
end;
end.