Ver Mensaje Individual
  #2  
Antiguo 07-10-2013
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 25
Caral Va por buen camino
Hola
Código Delphi [-]
procedure TForm20.BitBtn6Click(Sender: TObject);
begin
DBEdit4.SetFocus;
Table1.Open;
    c:=Table1.FieldByName('Cod_turnovet').Asinteger;
    c:=c+1;
    Table1.Append;
    BitBtn6.Enabled:=False;
    BitBtn3.Enabled:=false;
    BitBtn2.Enabled:=true;
    BitBtn4.Enabled:=true;
    DBEdit2.Visible:=false;
    DateTimePicker1.Visible:=true;
end;

Código Delphi [-]
procedure TForm20.BitBtn4Click(Sender: TObject);
begin
cv:= ('Cod_vete').integer;
f:=('Fecha').datetime;

//comparo si el veterinario seleccionado es el mismo y si la fecha es la misma a alguna seleccionada
 if (table1.FieldByName('Cod_vete').AsInteger = cv) and (table1.FieldByName('Fecha')= f) then
    begin
          // Si hay horas y minutos seleccionados...
          if (ComboBox3.ItemIndex <> -1) and (ComboBox2.ItemIndex <> -1)  then
          begin
          table1.FieldByName('Cod_turnovet').AsInteger:=c;
          table1.FieldByName('Cod_propi').AsInteger:=Table3.FieldByName('Cod_prop').AsInteger;
          Table1.FieldByName('Hora').AsDateTime := EncodeTime(
          StrToInt(ComboBox3.Items[ComboBox3.ItemIndex]),     // Horas
          StrToInt(ComboBox2.Items[ComboBox2.ItemIndex]), //Minutos
          0, 0); // Segundos, ms
          hr:=('Hora').datetime;
         end;
          if not Table1.FieldByName('Hora').AsDateTime = hr then
            begin
            table1.Post;
            BitBtn5.Enabled:=True;
            BitBtn6.Enabled:=True;
            BitBtn4.Enabled:=false;
           BitBtn3.Enabled:=True;
           DateTimePicker1.Visible:=false;
           DBEdit2.Visible:=true;
          end
        else
          ShowMessage('Debe ingresar horas y minutos');
end;
end;
Saludos
__________________
Siempre Novato
Responder Con Cita