-
Notifications
You must be signed in to change notification settings - Fork 2
/
itemsclientes.cpp
76 lines (64 loc) · 2.42 KB
/
itemsclientes.cpp
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
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "itemsclientes.h"
#include "basedatos.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormItemsClientes *FormItemsClientes;
//---------------------------------------------------------------------------
__fastcall TFormItemsClientes::TFormItemsClientes(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFormItemsClientes::ToolButtonAgregarClick(TObject *Sender)
{
if (PageControl->ActivePageIndex == 0)
{
DBGridLocalidades->SetFocus();
BD->TableLocalidades->Append();
}
else if (PageControl->ActivePageIndex == 1)
{
DBGridTiposNegocios->SetFocus();
BD->TableTiposNegocios->Append();
}
}
//---------------------------------------------------------------------------
void __fastcall TFormItemsClientes::ToolButtonEliminarClick(
TObject *Sender)
{
if (PageControl->ActivePageIndex == 0)
BD->TableLocalidades->Delete();
if (PageControl->ActivePageIndex == 1)
BD->TableTiposNegocios->Delete();
}
//---------------------------------------------------------------------------
void TFormItemsClientes::Mostrar(int numero)
{
PageControl->ActivePageIndex = numero;
ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TFormItemsClientes::DBGridKeyDown(
TObject *Sender, WORD &Key, TShiftState Shift)
{
// Anulo los atajos por defecto para agregar y eliminar filas
if ((Shift.Contains(ssCtrl) && Key == VK_DELETE) || Key == VK_INSERT)
{
Abort();
}
}
//---------------------------------------------------------------------------
void __fastcall TFormItemsClientes::MenuItemAgregarClick(TObject *Sender)
{
ToolButtonAgregar->Click();
}
//---------------------------------------------------------------------------
void __fastcall TFormItemsClientes::MenuItemEliminarClick(TObject *Sender)
{
ToolButtonEliminar->Click();
}
//---------------------------------------------------------------------------