//---------------------------------------------------------------------------

#ifndef clientesH
#define clientesH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "ZAbstractDataset.hpp"
#include "ZAbstractRODataset.hpp"
#include "ZConnection.hpp"
#include "ZDataset.hpp"
#include "ZSqlUpdate.hpp"
#include <ComCtrls.hpp>
#include <DB.hpp>
#include <DBGrids.hpp>
#include <ExtCtrls.hpp>
#include <Grids.hpp>
#include <Buttons.hpp>
#include <ImgList.hpp>
#include <DBCtrls.hpp>
#include <Mask.hpp>
#include <Menus.hpp>
//---------------------------------------------------------------------------
class TgestionClientes : public TForm
{
__published:	// IDE-managed Components
        TPageControl *PageControl1;
        TTabSheet *TabSheet1;
        TTabSheet *TabSheet2;
        TPanel *Panel1;
        TDBGrid *DBGrid1;
        TZConnection *ZConnection1;
        TZQuery *zqClientes;
        TZUpdateSQL *zuClientes;
        TDataSource *dsClientes;
        TLabel *Label1;
        TComboBox *srch_kFilter;
        TEdit *srch_vFilter;
        TBitBtn *BitBtn1;
        TComboBox *srch_agentes;
        TImageList *gridIcons;
        TLabel *Label2;
        TDBEdit *DBEdit1;
        TPageControl *PageControl2;
        TTabSheet *TabSheet3;
        TTabSheet *TabSheet4;
        TTabSheet *TabSheet5;
        TDBMemo *DBMemo1;
        TDBGrid *DBGrid2;
        TPanel *Panel2;
        TDBGrid *DBGrid3;
        TDBNavigator *DBNavigator1;
        TLabel *Label4;
        TDBText *DBText1;
        TLabel *Label5;
        TDBEdit *DBEdit2;
        TLabel *Label6;
        TDBEdit *DBEdit3;
        TLabel *Label7;
        TDBEdit *DBEdit4;
        TLabel *Label8;
        TDBEdit *DBEdit5;
        TLabel *Label9;
        TDBEdit *DBEdit6;
        TLabel *Label10;
        TDBEdit *DBEdit7;
        TLabel *Label11;
        TDBEdit *DBEdit8;
        TLabel *Label12;
        TDBEdit *DBEdit9;
        TLabel *Label13;
        TDBEdit *DBEdit10;
        TLabel *Label14;
        TDBEdit *DBEdit11;
        TLabel *Label15;
        TLabel *Label16;
        TLabel *lbEdad;
        TDateTimePicker *DateTimePicker1;
        TLabel *Label18;
        TComboBox *dbEstadoCivil;
        TGroupBox *GroupBox1;
        TLabel *Label3;
        TLabel *Label19;
        TCheckBox *dbPCargo;
        TIntegerField *zqClientesid;
        TIntegerField *zqClientesagente;
        TStringField *zqClientesagenteNombre;
        TStringField *zqClientesnombre;
        TStringField *zqClientesdni;
        TStringField *zqClientescalle;
        TStringField *zqClientespoblacion;
        TStringField *zqClientesprovincia;
        TStringField *zqClientescp;
        TStringField *zqClientestelefono;
        TStringField *zqClientesmovil;
        TStringField *zqClientesfax;
        TStringField *zqClientescorreo;
        TStringField *zqClientescobroCalle;
        TStringField *zqClientesestado;
        TIntegerField *zqClientesgradoFidelidad;
        TStringField *zqClientespCargo;
        TDateField *zqClientesfechaNacimiento;
        TDateField *zqClientesfecha;
        TTimeField *zqClienteshora;
        TMemoField *zqClientesnotas;
        TMainMenu *MainMenu1;
        TMenuItem *menu_Clientes1;
        TMenuItem *menu_Agentes1;
        TMenuItem *ImprimirFicha1;
        TMenuItem *ImprimirListado1;
        TMenuItem *GestindeAgentes1;
        TMenuItem *CuentaPolizas1;
        TMenuItem *Salir1;
        TZQuery *zqFamiliares;
        TDataSource *dsFamiliares;
        TIntegerField *zqFamiliaresid;
        TIntegerField *zqFamiliarescliente;
        TStringField *zqFamiliaresnombre;
        TStringField *zqFamiliaresdni;
        TStringField *zqFamiliaressexo;
        TStringField *zqFamiliaresestado;
        TStringField *zqFamiliaresrelacion;
        TDateField *zqFamiliaresfechaNacimiento;
        TZQuery *zqServicios;
        TDataSource *dsServicios;
        TIntegerField *zqServiciosid;
        TIntegerField *zqServicioscliente;
        TIntegerField *zqServiciostipoServicio;
        TStringField *zqServiciosnPoliza;
        TDateField *zqServiciosfechaEfecto;
        TDateField *zqServiciosfechaVencimiento;
        TFloatField *zqServiciosprimaNeta;
        TZQuery *zqTipoServicios;
        TIntegerField *zqTipoServiciosid;
        TStringField *zqTipoServiciosnombre;
        TStringField *zqServiciosnombreServicio;
        TZUpdateSQL *zuServicios;
        TDataSource *dsAgentes;
        TMenuItem *TiposdeServicio1;
        TMenuItem *N1;
        TDataSource *dsTipoServicios;
        TDBLookupComboBox *DBLookupComboBox1;
        TZQuery *zqAgentes;
        TImageList *ImageList1;
        TComboBox *cbGradoFidelidad;
        TTabSheet *TabSheet6;
        TDBGrid *DBGrid4;
        TDataSource *dsServiciosExternos;
        TZQuery *zqServiciosExternos;
        TIntegerField *IntegerField1;
        TIntegerField *IntegerField2;
        TIntegerField *IntegerField3;
        TStringField *StringField1;
        TDateField *DateField1;
        TDateField *DateField2;
        TFloatField *FloatField1;
        TStringField *StringField2;
        TZUpdateSQL *zuServiciosExternos;
        TLabel *Label17;
        TDateTimePicker *DateTimePicker2;
        TDateField *zqClientesfechaCarnet;
        void __fastcall FormShow(TObject *Sender);
        void __fastcall DBGrid1DblClick(TObject *Sender);
        void __fastcall DBGrid1TitleClick(TColumn *Column);
        void __fastcall doFilterClick(TObject *Sender);
        void __fastcall DBGrid1DrawColumnCell(TObject *Sender,
          const TRect &Rect, int DataCol, TColumn *Column,
          TGridDrawState State);
        void __fastcall zqClientesBeforePost(TDataSet *DataSet);
        void __fastcall DateTimePicker1CloseUp(TObject *Sender);
        void __fastcall zqClientesAfterScroll(TDataSet *DataSet);
        void __fastcall dbEstadoCivilChange(TObject *Sender);
        void __fastcall dbPCargoClick(TObject *Sender);
        void __fastcall Salir1Click(TObject *Sender);
        void __fastcall GestindeAgentes1Click(TObject *Sender);
        void __fastcall zqFamiliaresNewRecord(TDataSet *DataSet);
        void __fastcall zqFamiliaresBeforePost(TDataSet *DataSet);
        void __fastcall zqFamiliaresestadoGetText(TField *Sender,
          AnsiString &Text, bool DisplayText);
        void __fastcall zqFamiliaresrelacionGetText(TField *Sender,
          AnsiString &Text, bool DisplayText);
        void __fastcall zqFamiliaressexoGetText(TField *Sender,
          AnsiString &Text, bool DisplayText);
        void __fastcall zqServiciosNewRecord(TDataSet *DataSet);
        void __fastcall TiposdeServicio1Click(TObject *Sender);
        void __fastcall ImprimirListado1Click(TObject *Sender);
        void __fastcall ImprimirFicha1Click(TObject *Sender);
        void __fastcall CuentaPolizas1Click(TObject *Sender);
        void __fastcall dsClientesStateChange(TObject *Sender);
        void __fastcall zqClientesAfterPost(TDataSet *DataSet);
        void __fastcall cbGradoFidelidadChange(TObject *Sender);
        void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
        void __fastcall zqServiciosExternosNewRecord(TDataSet *DataSet);
        void __fastcall PageControl2Changing(TObject *Sender,
          bool &AllowChange);
private:	// User declarations
        void __fastcall MyWndProc(Messages::TMessage &Message);
        AnsiString dsListado_sort;
        int dsListado_Indice;
        bool dbUpdating, gettingAutoIncrement;

public:		// User declarations
        __fastcall TgestionClientes(TComponent* Owner);

};
//---------------------------------------------------------------------------
extern PACKAGE TgestionClientes *gestionClientes;
//---------------------------------------------------------------------------
#endif
