30,7 → 30,6 |
ComboBox1: TComboBox; |
Label1: TLabel; |
Label2: TLabel; |
ADOTable1BEMERKUNG: TStringField; |
procedure ADOTable1NewRecord(DataSet: TDataSet); |
procedure FormClose(Sender: TObject; var Action: TCloseAction); |
procedure ADOTable1BeforePost(DataSet: TDataSet); |
86,7 → 85,7 |
{$R *.dfm} |
|
// TODO: Trennstriche zwischen Wochen oder zwischen Urlauben |
// IDEE: Wochenend-Multiplikator |
// TODO: Anmerkungen |
|
uses |
DateUtils, StrUtils, IniFiles; |
115,11 → 114,17 |
end; |
end; |
|
function MinutenZuHF_Int(min: integer): string; |
function MinutenZuHF(f: TField): string; |
var |
d: integer; |
begin |
d := min; |
if IstLeer(f) then |
begin |
result := ''; |
end |
else |
begin |
d := f.AsInteger; |
if d < 0 then |
begin |
result := '-'; |
131,18 → 136,7 |
end; |
result := result + Format('%.2d:%.2d', [d div 60, d mod 60]); |
end; |
|
function MinutenZuHF(f: TField): string; |
begin |
if IstLeer(f) then |
begin |
result := ''; |
end |
else |
begin |
result := MinutenZuHF_Int(f.AsInteger); |
end; |
end; |
|
function EchtesDatum(f: TField): TDate; |
begin |
202,6 → 196,8 |
bakEv: TDataSetNotifyEvent; |
dead: boolean; |
begin |
if ADOTable1.ReadOnly then exit; |
|
if ADOTable1TAG.IsNull then |
begin |
baks := ''; |
213,11 → 209,9 |
else |
DateTimeToString(baks, 'YYYY-MM-DD', ADOTable1TAG.AsDateTime); |
end; |
ADOTable1.Requery(); |
|
bakEv := ADOTable1.AfterPost; |
ADOTable1.AfterPost := nil; |
ADOTable1.DisableControls; |
ADOTable1.Requery(); |
try |
ADOTable1.First; |
saldo := 0; |
243,7 → 237,6 |
finally |
if baks <> '' then ADOTable1.Locate('USERNAME;TAG', VarArrayOf([WUserName, baks]), []); |
ADOTable1.AfterPost := bakEv; |
ADOTable1.EnableControls; |
end; |
end; |
|
365,7 → 358,7 |
try |
test.Connection := ADOConnection1; |
test.Close; |
test.SQL.Text := 'select * from TAGE where TAG = ''' + DateToStr(Date) + ''' and USERNAME = ''' + SQL_Escape(ComboBox1.Text) + ''''; |
test.SQL.Text := 'select * from TAGE where TAG = ''' + DateToStr(Date) + ''''; |
test.Open; |
if test.RecordCount = 0 then |
begin |
447,9 → 440,6 |
procedure TForm1.ADOTable1TAGGetText(Sender: TField; var Text: string; |
DisplayText: Boolean); |
begin |
if IstLeer(Sender) then |
Text := Sender.AsString |
else |
Text := DateToStr(EchtesDatum(Sender)); |
end; |
|
515,26 → 505,18 |
|
procedure TForm1.ComboBox1Change(Sender: TObject); |
begin |
Label2.Caption := MinutenZuHF_Int(RegelArbeitszeit) + ' Std.'; |
|
ADOTable1.DisableControls; |
|
ADOTable1.Active := false; |
ADOTable1.ReadOnly := false; |
ADOTable1.ReadOnly := ComboBox1.Text <> WUserName; |
ADOTable1.Filter := 'USERNAME = ''' + SQL_Escape(ComboBox1.Text) + ''''; |
ADOTable1.Filtered := true; |
ADOTable1.Active := true; |
ADOTable1.Last; |
|
ReorgAll; |
Button1.Enabled := not ADOTable1.ReadOnly; |
|
ADOTable1.Active := false; |
ADOTable1.ReadOnly := ComboBox1.Text <> WUserName; |
ADOTable1.Active := true; |
Label2.Caption := IntToStr(RegelArbeitszeit); |
|
ADOTable1.Last; |
Button1.Enabled := not ADOTable1.ReadOnly; |
|
ADOTable1.EnableControls; |
ReorgAll; |
end; |
|
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); |
604,8 → 586,7 |
begin |
if Highlight then exit; |
|
if (Field.FieldName = ADOTable1WOCHENTAG.FieldName) or |
(Field.FieldName = ADOTable1BERSTUNDEN.FieldName) or |
if (Field.FieldName = ADOTable1BERSTUNDEN.FieldName) or |
(Field.FieldName = ADOTable1BERSTUNDEN_SALDO.FieldName) then |
begin |
ABrush.Color := clBtnFace; |