unit UFechasEmp;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Data.Win.ADODB, Vcl.StdCtrls,
  Vcl.DBCtrls, Vcl.Buttons, Vcl.Mask, JvExMask, JvToolEdit, JvMaskEdit,
  JvCheckedMaskEdit, JvDatePickerEdit, JvDBDatePickerEdit;

type
  TFechasEmp = class(TForm)
    Label19: TLabel;
    DBComboBox1: TDBComboBox;
    DSFechasEmp: TDataSource;
    TFechasEmp: TADOTable;
    Label1: TLabel;
    JvDBDatePickerEdit1: TJvDBDatePickerEdit;
    JvDBDatePickerEdit2: TJvDBDatePickerEdit;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    JvDBDatePickerEdit3: TJvDBDatePickerEdit;
    JvDBDatePickerEdit4: TJvDBDatePickerEdit;
    btnGuardar: TBitBtn;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    procedure BitBtn2Click(Sender: TObject);
    procedure btnGuardarClick(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure TFechasEmpBeforePost(DataSet: TDataSet);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FechasEmp: TFechasEmp;

implementation

{$R *.dfm}

uses Udm, UPrincipal;

procedure TFechasEmp.BitBtn1Click(Sender: TObject);
begin
TFechasEmp.Cancel;
close;
end;

procedure TFechasEmp.BitBtn2Click(Sender: TObject);
begin
 TFechasEmp.Edit;
end;

procedure TFechasEmp.btnGuardarClick(Sender: TObject);
begin
  TFechasEmp.Post;
end;

procedure TFechasEmp.FormCreate(Sender: TObject);
 var
   anio: string;
begin
   //anio := inttostr(CurrentYear());
   //DBComboBox1.Text:= anio;
end;

procedure TFechasEmp.TFechasEmpBeforePost(DataSet: TDataSet);
begin
 TFechasEmp.FieldByName('Empleado').AsInteger :=  Form1.TEmpleados.FieldByName('ide').AsInteger;
end;

end.
