注销代码:
procedure TW_Main.M_Login_OutClick(Sender: TObject);
begin
G_Thread_SX:=True;//标明线程仍存在;
。。。。。。//一些菜单操作;
end;
重新登入代码:
登入画面formshow中:
procedure TW_Login.FormShow(Sender: TObject);
begin
with Query1do
begin
Close;
SQL.Clear;
SQL.Add('Select * from soft_user');
Open;
if Not Eof then
begin
//从数据库中取一些全局变量;
G_SoftUser:=FieldByName('name').asString;
G_Default_Sample:=FieldByName('Default_Sample').AsString;
G_Default_Sample_State:=FieldByName('Default_Sample_State').AsString;
G_Default_Fee_Type:=FieldByName('Default_Fee_Type').AsString;
G_LowColor:=FieldByName('Low_Color').AsInteger;
G_HighColor:=FieldByName('High_Color').AsInteger;
G_Maintain_Days:=FieldByName('History_Days').AsInteger;
G_Preview_Flag:=FieldByName('Preview_Flag').AsBoolean;
G_Hint_flag:=FieldByName('Hint_Flag').AsBoolean;
end;
Close;
end;
在登入画面的代码输入后,也无非是对数据库操作取出姓名来而已;
procedure TW_Login.E_IDKeyPress(Sender: TObject;
var Key: Char);
var
temp_count:Integer;
begin
if Key=chr(13) then
begin
with query1do
begin
Close;
SQL.Clear;
SQL.Add('Select * from op_password,physician where op_password.op_id=physician.work_id');
SQL.Add('and op_password.op_id='''+Trim(E_ID.text)+'''');
Open;
if Eof then
begin
Close;
MessageBox(0,'¸该操作员不存在,请重输¡',‘提示',MB_OK+MB_ICONWARNING+MB_DEFBUTTON1+MB_TASKMODAl);
E_ID.Text:='';
BB_Login.Enabled:=False;
E_ID.SetFocus;
Exit;
end;
E_Name.Text:=FieldbyName('name').AsString;
Close;
BB_Login.Enabled:=true;
E_Password.SetFocus;
end;
end;
end;
end.
请各位大侠指教!