-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathotdform.cpp
More file actions
43 lines (40 loc) · 1.43 KB
/
otdform.cpp
File metadata and controls
43 lines (40 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
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
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "otdform.h"
#include "dmform.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "FIBDatabase"
#pragma link "FIBDataSet"
#pragma link "pFIBDatabase"
#pragma link "pFIBDataSet"
#pragma link "DBCtrlsEh"
#pragma link "DBLookupEh"
#pragma link "DBGridEh"
#pragma resource "*.dfm"
TOtdelForm *OtdelForm;
static bool FirstTime = true;
//---------------------------------------------------------------------------
__fastcall TOtdelForm::TOtdelForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TOtdelForm::GridOtdelKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift){
if((Key == VK_DELETE)&&!(DM->dsOtdel->State==dsEdit))
try{
DM->dsOtdel->Delete();
}
catch(const Exception &E){
Application->MessageBox("Íåâîçìîæíî óäàëèòü ñïåöèàëüíîñòü.", "Îøèáêà", MB_OK);
}
}
//---------------------------------------------------------------------------
void __fastcall TOtdelForm::FormClose(TObject *Sender,
TCloseAction &Action){
if(DM->dsOtdel->State==dsEdit)DM->dsOtdel->Post();
if(DM->dsOtdel->State==dsInsert)DM->dsOtdel->Cancel();
}
//---------------------------------------------------------------------------