- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
procedure TFrmCashBook.ButtonGroupDeleteClick(Sender: TObject);
var
CmpField : String;
CmpOperator : String;
StringToCmp : String;
DeletedCount : Integer;
begin
if MessageDLG('Âû óâåðåíû?', mtConfirmation,
[mbYes,mbNo],0) <> mrYes then Exit;
CmpField := GroupDeleteSelectFieldComboBox.Text;
CmpOperator := GroupDeleteSelectComparisonOperatorComboBox.Text;
// âîçìîæíûå îïåðàòîðû '=', '>', '>=', '<', '<='
StringToCmp := GroupDeleteEdit.Text;
DeletedCount := 0;
with DM.TblCashBook do begin
First();
while not EOF do begin
if ( (CmpOperator = '=' ) and
(FieldByName(CmpField).AsString = StringToCmp ) ) or
( (CmpOperator = '>' ) and
(FieldByName(CmpField).AsString > StringToCmp) ) or
( (CmpOperator = '>=') and
(FieldByName(CmpField).AsString >= StringToCmp) ) or
( (CmpOperator = '<' ) and
(FieldByName(CmpField).AsString < StringToCmp) ) or
( (CmpOperator = '<=') and
(FieldByName(CmpField).AsString <= StringToCmp) ) then
begin
Delete();
DeletedCount := DeletedCount + 1;
end
else //åñëè çàïèñü óäàëåíà, next() íå íóæåí
Next();
end;
end; //with
ShowMessage('Óäàëåíî çàïèñåé: ' + inttostr(DeletedCount));
end;
guest 16.01.2010 14:12 # −1
TarasB 16.01.2010 14:32 # 0
guest 16.01.2010 15:53 # −4.2
guest 16.01.2010 16:20 # +3.2
guest 16.01.2010 19:33 # 0
guest 16.01.2010 17:46 # +4.2
guest 16.01.2010 17:47 # 0
guest 16.01.2010 19:48 # 0
guest 16.01.2010 21:09 # 0
nil 23.01.2010 01:22 # 0
*мечтательно* Хотел бы я говнокод для машины Тьюринга увидеть...
guest 17.02.2010 17:56 # 0
000+00+0
00+00+00
0+0000+0
00+0+0++