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;
if (table1.FieldByName('Cod_vete').AsInteger = cv) and (table1.FieldByName('Fecha')= f) then
begin
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]), StrToInt(ComboBox2.Items[ComboBox2.ItemIndex]), 0, 0); 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