-
Notifications
You must be signed in to change notification settings - Fork 0
/
ufrmMantenerProductos.pas
129 lines (111 loc) · 2.95 KB
/
ufrmMantenerProductos.pas
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
unit ufrmMantenerProductos;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, IBCustomDataSet,
IBTable, DBGridEhGrouping, ToolCtrlsEh, DBGridEhToolCtrls, DynVarsEh,
EhLibVCL, GridsEh, DBAxisGridsEh, DBGridEh, Vcl.ExtCtrls, Vcl.DBCtrls,
Vcl.StdCtrls, Vcl.ComCtrls, dr2gcomponentes, Vcl.ToolWin, ufrmTemplateDatos;
type
TfrmMantenerProductos = class(TfrmDatos)
tblProd: TIBTable;
tblPrecios: TIBTable;
dsProd: TDataSource;
dsPrecios: TDataSource;
tblProdID: TLargeintField;
tblProdCODIGO: TIBStringField;
tblProdORIGEN: TIBStringField;
tblProdDESCRIPCION: TIBStringField;
tblProdACTIVO: TSmallintField;
tblProdIMPUESTO: TIBStringField;
tblPreciosID: TLargeintField;
tblPreciosPRODUCTOS_ID: TLargeintField;
tblPreciosPRECIO_VENTA: TFloatField;
tblPreciosMAYORISTA: TSmallintField;
header1: TDxHeader;
pgc1: TPageControl;
TabSheet1: TTabSheet;
gridProductos: TDBGridEh;
pnl1: TPanel;
tlb1: TToolBar;
dbnvgrProd: TDBNavigator;
pgc2: TPageControl;
tsPrecios: TTabSheet;
spl1: TSplitter;
gridPrecios: TDBGridEh;
dbnvgrPrecios: TDBNavigator;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure tblPreciosNewRecord(DataSet: TDataSet);
procedure dbnvgrProdClick(Sender: TObject; Button: TNavigateBtn);
procedure dbnvgrPreciosClick(Sender: TObject; Button: TNavigateBtn);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmMantenerProductos: TfrmMantenerProductos;
implementation
uses
datos;
{$R *.dfm}
procedure TfrmMantenerProductos.dbnvgrPreciosClick(Sender: TObject;
Button: TNavigateBtn);
begin
inherited;
case Button of
nbFirst: ;
nbPrior: ;
nbNext: ;
nbLast: ;
nbInsert: tblPrecios.Append ;
nbDelete: ;
nbEdit: ;
nbPost: ;
nbCancel: ;
nbRefresh: ;
nbApplyUpdates: ;
nbCancelUpdates: ;
end;
end;
procedure TfrmMantenerProductos.dbnvgrProdClick(Sender: TObject;
Button: TNavigateBtn);
begin
inherited;
case Button of
nbFirst: ;
nbPrior: ;
nbNext: ;
nbLast: ;
nbInsert: tblProd.Append;
nbDelete: ;
nbEdit: ;
nbPost: ;
nbCancel: ;
nbRefresh: ;
nbApplyUpdates: ;
nbCancelUpdates: ;
end;
end;
procedure TfrmMantenerProductos.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
if tblProd.Transaction.InTransaction then
tblprod.Transaction.CommitRetaining;
if tblPrecios.Transaction.InTransaction then
tblPrecios.Transaction.CommitRetaining;
inherited;
end;
procedure TfrmMantenerProductos.FormCreate(Sender: TObject);
begin
inherited;
tblProd.Open;
tblPrecios.Open;
end;
procedure TfrmMantenerProductos.tblPreciosNewRecord(DataSet: TDataSet);
begin
inherited;
tblPreciosPRODUCTOS_ID.Value := tblProdID.Value;
end;
end.