edit3.Text:='';
end;
end;
end;
procedure TForm_infos_del.Button2Click(Sender: TObject);
begin
if Form_infos_del.Edit2.Text<>'' then
begin
Form_info_q3.Edit5.Text:=Form_infos_del.Edit2.Text;
Form_info_q3.Show;
Form_info_q3.Button1.Click;
if Form_info_q3.query1.RecordCount>0 then
Button3.enabled:=true
else
begin
Button3.enabled:=false;
edit2.SetFocus;
end;
end
else
begin
showmessage('请填写要查找的寝室号!');
end;
end;
来访进入楼时的登记窗体:
procedure TForm_vist_in.Button2Click(Sender: TObject);
begin
if (edit1.Text<>'') and (edit5.Text<>'') and (edit2.Text<>'') then
begin
query1.Close;
query1.SQL.Clear;
query1.SQL.Add('insert into vist_log (visitor_name,host_name,host_room,relation,time_in,time_out,watch,certificate,remark) values(:visitor_name,:host_name,:host_room,:relation,:time_in,:time_out,:watch,:certificate,:remark)');
query1.ParamByName('visitor_name').AsString:=Edit2.Text;
query1.ParamByName('host_name').AsString:=Edit1.Text;
query1.ParamByName('host_room').AsString:=Edit5.Text;
query1.ParamByName('relation').AsString:=ComboBox1.Text;
query1.ParamByName('time_in').AsString:=Edit3.Text;
query1.ParamByName('time_out').AsString:=Edit4.Text;
query1.ParamByName('watch').AsString:=ComboBox2.Text;
query1.ParamByName('certificate').AsString:=ComboBox3.Text;
query1.ParamByName('remark').AsString:=Memo1.Text;
query1.ExecSQL;
showmessage('已记入数据库,访问完请急时下楼登记!');
Form_vist_in.Close;
end
else
begin
showmessage('请完整填写信息!');
end;
end;
来访出楼时的登记窗体:
procedure TForm_vist_out2.Button1Click(Sender: TObject);
begin
query1.Close;
query1.SQL.Clear;
query1.SQL.Add('update vist_log set time_out=:time_out ,is_out=1 where id=:id');
query1.ParamByName('time_out').AsString:=Edit4.Text;
query1.ParamByName('id').AsInteger:=Form_vist_out.DataSource1.DataSet.FieldList.Fields[0].Value;
query1.ExecSQL;
showmessage('登记完毕!');
Form_vist_out2.Close;
end;
10.贵重物品搬出登记:
procedure TForm_valuables_move.Button1Click(Sender: TObject);
begin
if (Edit1.Text<>'') and (Edit2.Text<>'') and (Edit3.Text<>'') and(Edit4.Text<>'') and(Edit5.Text<>'') then
begin
query1.Close;
query1.ParamByName('name_res