- 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
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
Procedure TfMain.CheckButtonsStatus;
begin
// Если есть кто-то в персональной очереди, то возобновить активна
if (dMain.PersonalQueueQuery.RecordCount > 0) then
TImageButton(mButtons[6]).mlabel.Enabled := true
else
TImageButton(mButtons[6]).mlabel.Enabled := False;
// 'приглашен', 3, 'оповещен', 4, 'оповещен', 5, 'прием начат')
if (dMain.StateQuery.FieldValues['state'] = 'свободно') then
begin
TImageButton(mButtons[0]).mlabel.Enabled := False;
TImageButton(mButtons[1]).mlabel.Enabled := False;
if dMain.CommonQueueQuery.RecordCount > 0 then
TImageButton(mButtons[2]).mlabel.Enabled := true
else
TImageButton(mButtons[2]).mlabel.Enabled := False;
TImageButton(mButtons[3]).mlabel.Enabled := False;
TImageButton(mButtons[4]).mlabel.Enabled := False;
TImageButton(mButtons[5]).mlabel.Enabled := False;
OperPopupMenu.Items[0].Enabled := False;
end;
if (dMain.StateQuery.FieldValues['state'] = 'приглашен') or
(dMain.StateQuery.FieldValues['state'] = 'оповещен') then
begin
TImageButton(mButtons[0]).mlabel.Enabled := true;
TImageButton(mButtons[1]).mlabel.Enabled := False;
TImageButton(mButtons[2]).mlabel.Enabled := False;
TImageButton(mButtons[3]).mlabel.Enabled := true;
TImageButton(mButtons[4]).mlabel.Enabled := False;
TImageButton(mButtons[5]).mlabel.Enabled := False;
TImageButton(mButtons[6]).mlabel.Enabled := False;
if (dMain.StateQuery.FieldValues['state'] = 'приглашен') then
OperPopupMenu.Items[0].Enabled := False
else
OperPopupMenu.Items[0].Enabled := true;
end;
if (dMain.StateQuery.FieldValues['state'] = 'прием начат') then
begin
TImageButton(mButtons[0]).mlabel.Enabled := False;
TImageButton(mButtons[1]).mlabel.Enabled := true;
TImageButton(mButtons[2]).mlabel.Enabled := False;
TImageButton(mButtons[3]).mlabel.Enabled := False;
TImageButton(mButtons[4]).mlabel.Enabled := true;
TImageButton(mButtons[5]).mlabel.Enabled := true;
TImageButton(mButtons[6]).mlabel.Enabled := False;
OperPopupMenu.Items[0].Enabled := False;
end;
end;