{ Tconvert } Tconvert = class(TInvokableClass, Iconvert) public
function test(i: Integer): string; stdcall; function login(uid: string; pass: string): Boolean; stdcall; function drugmg(drugid: Integer): string; stdcall; function drugmt(drugid: Integer): string; stdcall; function drugsh(drugid: Integer): string; stdcall; function drugcod(drugid: Integer): string; stdcall; function druggb(drugid: Integer): string; stdcall; function drugho(drugid: Integer): string; stdcall; function drugmo(drugid: Integer): string; stdcall; function drugma(drugid: Integer): string; stdcall; function drugotc(drugid: Integer): string; stdcall; function drugotc_msg(drugid: Integer): string; stdcall; function drugtedp(drugid: Integer): string; stdcall; function drughsef(drugid: Integer): string; stdcall; function druggkh(drugid: Integer): string; stdcall; function druggfo(drugid: Integer): string; stdcall; function drugosef(drugid: Integer): string; stdcall; function drugvcod(drugid: Integer): string; stdcall; function drugmot1(drugid: Integer): string; stdcall; function drugmot2(drugid: Integer): string; stdcall; function drugjay1(drugid: Integer): string; stdcall; function drugjay2(drugid: Integer): string; stdcall; function drugtad1(drugid: Integer): string; stdcall; function drugtad2(drugid: Integer): string; stdcall; function drugtad3(drugid: Integer): string; stdcall; function drugtad4(drugid: Integer): string; stdcall; function drugtadmsg(drugid: Integer): string; stdcall; function drugfn(drugid: Integer): string; stdcall; function drugdoz(drugid: Integer): string; stdcall; function drugdas(drugid: Integer): string; stdcall; function drugtmp(drugid: Integer): string; stdcall; function druglastchange(drugid: Integer): string; stdcall; function drugrundat(drugid: Integer): string; stdcall; function drugchanger(drugid: Integer): string; stdcall; function drugnewpr(drugid: Integer): string; stdcall; function druglist(): string; stdcall; function currusernam(uid: string): string; stdcall; function curruserfam(uid: string): string; stdcall; function curruserlimit(uid: string): string; stdcall; function curruseraddr(uid: string): string; stdcall; function currusertel(uid: string): string; stdcall; function druginsert(values: string): Boolean; stdcall; function drugupdate(drugid: Integer; values: string): Boolean; stdcall; function drugdelete(drugid: Integer; values: string): Boolean; stdcall; function LOGINinsert(values: string): Boolean; stdcall; function LOGINupdate(drugid: Integer; values: string): Boolean; stdcall; function LOGINdelete(drugid: Integer; values: string): Boolean; stdcall; end;
implementation
function Tconvert.LOGINupdate(drugid: Integer; values: string): Boolean; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := False; end; try tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.Connection.BeginTrans;
tmp.SQL.Clear;
tmp.SQL.Add('UPDATE LOGIN SET ' + VALUES + ' WHERE UID=''' + IntToStr(DRUGID) + '''');
tmp.ExecSQL;
tmp.Connection.CommitTrans;
Result := True; except
begin TMP.Connection.RollbackTrans;
Result := False; end;//EXCEPT tmp.Free;
conn.Connected := False;
conn.Free; end;//TRY end;//insertfunc
function Tconvert.drugupdate(drugid: Integer; values: string): Boolean; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := False; end; try tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.Connection.BeginTrans;
tmp.SQL.Clear;
tmp.SQL.Add('UPDATE drug SET ' + VALUES + ' WHERE DRUGID=''' + IntToStr(DRUGID) + '''');
tmp.ExecSQL;
tmp.Connection.CommitTrans;
Result := True; except
begin TMP.Connection.RollbackTrans;
Result := False; end;//EXCEPT tmp.Free;
conn.Connected := False;
conn.Free; end;//TRY end;//insertfunc
function Tconvert.drugdelete(drugid: Integer; values: string): Boolean; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := False; end; try tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.Connection.BeginTrans;
tmp.SQL.Clear;
tmp.SQL.Add('DELETE FROM drug WHERE DRUGID=''' + IntToStr(DRUGID) + '''');
tmp.ExecSQL;
tmp.Connection.CommitTrans;
Result := True; except
begin TMP.Connection.RollbackTrans;
Result := False; end;//EXCEPT tmp.Free;
conn.Connected := False;
conn.Free; end;//TRY end;//insertfunc
function Tconvert.LOGINdelete(drugid: Integer; values: string): Boolean; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := False; end; try tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.Connection.BeginTrans;
tmp.SQL.Clear;
tmp.SQL.Add('DELETE FROM LOGIN WHERE DRUGID=''' + IntToStr(DRUGID) + '''');
tmp.ExecSQL;
tmp.Connection.CommitTrans;
Result := True; except
begin TMP.Connection.RollbackTrans;
Result := False; end;//EXCEPT tmp.Free;
conn.Connected := False;
conn.Free; end;//TRY end;//insertfunc
function Tconvert.druginsert(values: string): Boolean; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := False; end; try tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.Connection.BeginTrans;
tmp.SQL.Clear;
tmp.SQL.Add('insert into drug values(' + values + ')');
tmp.ExecSQL;
tmp.Connection.CommitTrans;
Result := True; except
begin TMP.Connection.RollbackTrans;
Result := False; end;//EXCEPT tmp.Free;
conn.Connected := False;
conn.Free; end;//TRY end;//insertfunc
function Tconvert.LOGINinsert(values: string): Boolean; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := False; end; try tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.Connection.BeginTrans;
tmp.SQL.Clear;
tmp.SQL.Add('insert into LOGIN values(' + values + ')');
tmp.ExecSQL;
tmp.Connection.CommitTrans;
Result := True; except
begin TMP.Connection.RollbackTrans;
Result := False; end;//EXCEPT tmp.Free;
conn.Connected := False;
conn.Free; end;//TRY end;//insertfunc
function Tconvert.curruseraddr(uid: string): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select addr from login where (uid=N''' + uid + ''')');
tmp.ExecSQL;
tmp.Open;
Result := tmp.FieldByName('addr').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;//func
function Tconvert.currusertel(uid: string): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select tel from login where (uid=N''' + uid + ''')');
tmp.ExecSQL;
tmp.Open;
Result := tmp.FieldByName('tel').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;//func
function Tconvert.curruserlimit(uid: string): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select limit from login where (uid=N''' + uid + ''')');
tmp.ExecSQL;
tmp.Open;
Result := tmp.FieldByName('limit').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;//func
function Tconvert.curruserfam(uid: string): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select fam from login where (uid=N''' + uid + ''')');
tmp.ExecSQL;
tmp.Open;
Result := tmp.FieldByName('fam').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;//func
function Tconvert.currusernam(uid: string): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select nam from login where (uid=N''' + uid + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not found!' else Result := tmp.FieldByName('nam').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;//func
function tconvert.druglist(): string; var conn: tadoconnection;
tmp: tadoquery;
x: string; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select drugid from drug ');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else
begin tmp.First;
x := ''; while not tmp.EOF do
begin x := x + tmp.FieldByName('drugid').AsString;
tmp.Next; end;
Result := x; end;//if
function tconvert.drugtmp(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select tmp from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('tmp').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.druglastchange(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select lastchange from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('lastchange').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugchanger(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select changer from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('changer').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugrundat(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select rundat from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('rundat').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugnewpr(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select newpr from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('newpr').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugdas(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select das from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('das').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugdoz(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select doz from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('doz').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugfn(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select fn from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('fn').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugtadmsg(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select tadmsg from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('tadmsg').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugtad4(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select tad4 from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('tad4').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugtad3(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select tad3 from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('tad3').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugtad2(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select tad2 from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('tad2').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugtad1(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select tad1 from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('tad1').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugjay2(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select jay2 from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('jay2').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugjay1(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select jay1 from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('jay1').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugmot2(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select mot2 from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('mot2').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugmot1(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select mot1 from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('mot1').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugvcod(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select vcod from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('vcod').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugosef(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select osef from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('osef').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.druggfo(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select gfo from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('gfo').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.druggkh(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select gkh from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('gkh').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drughsef(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select hsef from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('hsef').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugtedp(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select tedp from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('tedp').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugotc_msg(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select otc_msg from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('otc_msg').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugotc(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select otc from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('otc').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugma(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select ma from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('ma').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugmo(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select mo from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('mo').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugho(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select ho from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('ho').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.druggb(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select gb from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('gb').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugcod(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select cod from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('cod').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugsh(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select sh from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('sh').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugmt(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select mt from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('mt').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.drugmg(drugid: Integer): string; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := 'Faild connection!'; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select mg from drug where (drugid=N''' + IntToStr(drugid) + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := 'Not Found!' else Result := tmp.FieldByName('mg').AsString;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.login(uid: string; pass: string): Boolean; var conn: tadoconnection;
tmp: tadoquery; begin
try conn := tadoconnection.Create(nil);
conn.ConnectionString :=
'Provider=SQLOLEDB.1;Password=z200t68i;Persist Security Info=True;User ID=irdrug;Initial Catalog=irdrug_data';
conn.LoginPrompt := False;
conn.Connected := True; except Result := False; end;
tmp := tadoquery.Create(nil);
tmp.Connection := conn;
tmp.SQL.Clear;
tmp.SQL.Add('select * from login where (uid=N''' + uid + ''') and (password=N''' +
pass + ''')');
tmp.ExecSQL;
tmp.Open; if tmp.IsEmpty then Result := False else Result := True;
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free; end;
function tconvert.test(i: Integer): string; begin
case i of 0: Result := 'Zero';
1: Result := 'one';
2: Result := 'two';
3: Result := 'three';
4: Result := 'four';
5: Result := 'five';
6: Result := 'six';
7: Result := 'seven';
8: Result := 'eight';
9: Result := 'nine'; else Result := 'out of range'; end; end;
initialization { Invokable classes must be registered } InvRegistry.RegisterInvokableClass(Tconvert); end.
{ Invokable interfaces must derive from IInvokable } Iconvert = interface(IInvokable)
['{9AC31ECA-37C4-42C2-9E9D-1E0117A8C746}'] function test(i: Integer): string; stdcall; function login(uid: string; pass: string): Boolean; stdcall; function drugmg(drugid: Integer): string; stdcall; function drugmt(drugid: Integer): string; stdcall; function drugsh(drugid: Integer): string; stdcall; function drugcod(drugid: Integer): string; stdcall; function druggb(drugid: Integer): string; stdcall; function drugho(drugid: Integer): string; stdcall; function drugmo(drugid: Integer): string; stdcall; function drugma(drugid: Integer): string; stdcall; function drugotc(drugid: Integer): string; stdcall; function drugotc_msg(drugid: Integer): string; stdcall; function drugtedp(drugid: Integer): string; stdcall; function drughsef(drugid: Integer): string; stdcall; function druggkh(drugid: Integer): string; stdcall; function druggfo(drugid: Integer): string; stdcall; function drugosef(drugid: Integer): string; stdcall; function drugvcod(drugid: Integer): string; stdcall; function drugmot1(drugid: Integer): string; stdcall; function drugmot2(drugid: Integer): string; stdcall; function drugjay1(drugid: Integer): string; stdcall; function drugjay2(drugid: Integer): string; stdcall; function drugtad1(drugid: Integer): string; stdcall; function drugtad2(drugid: Integer): string; stdcall; function drugtad3(drugid: Integer): string; stdcall; function drugtad4(drugid: Integer): string; stdcall; function drugtadmsg(drugid: Integer): string; stdcall; function drugfn(drugid: Integer): string; stdcall; function drugdoz(drugid: Integer): string; stdcall; function drugdas(drugid: Integer): string; stdcall; function drugtmp(drugid: Integer): string; stdcall; function druglastchange(drugid: Integer): string; stdcall; function drugrundat(drugid: Integer): string; stdcall; function drugchanger(drugid: Integer): string; stdcall; function drugnewpr(drugid: Integer): string; stdcall; function druglist(): string; stdcall; //list koliye drug id ha function currusernam(uid: string): string; stdcall; function curruserfam(uid: string): string; stdcall; function curruserlimit(uid: string): string; stdcall; function curruseraddr(uid: string): string; stdcall; function currusertel(uid: string): string; stdcall; function druginsert(values: string): Boolean; stdcall; function drugupdate(drugid: Integer; values: string): Boolean; stdcall; function drugdelete(drugid: Integer; values: string): Boolean; stdcall; function LOGINinsert(values: string): Boolean; stdcall; function LOGINupdate(drugid: Integer; values: string): Boolean; stdcall; function LOGINdelete(drugid: Integer; values: string): Boolean; stdcall; { Methods of Invokable interface must not use the default }
{ calling convention; stdcall is recommended } end;
implementation
initialization { Invokable interfaces must be registered } InvRegistry.RegisterInterface(TypeInfo(Iconvert)); end.
{####################################################################}
{ SOAP WebModule }
{####################################################################} unit Unit1;