XML Delphi

Title: How to implement a soap web application server and client
unit convertImpl;
interface
uses sysutils, adodb, InvokeRegistry, Types, XSBuiltIns, convertIntf;
type
{ 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
tmp.Close;
tmp.Free;
conn.Connected := False;
conn.Free;
end;
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 interface Iconvert }
{####################################################################}
unit convertIntf;
interface
uses InvokeRegistry, Types, XSBuiltIns;
type
{ 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;
interface
uses
SysUtils, Classes, HTTPApp, InvokeRegistry, WSDLIntf, TypInfo,
WebServExp, WSDLBind, XMLSchema, WSDLPub, SOAPPasInv, SOAPHTTPPasInv,
SOAPHTTPDisp, WebBrokerSOAP;
type
TWebModule1 = class(TWebModule)
HTTPSoapDispatcher1: THTTPSoapDispatcher;
HTTPSoapPascalInvoker1: THTTPSoapPascalInvoker;
WSDLHTMLPublish1: TWSDLHTMLPublish;
procedure WebModule1DefaultHandlerAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
WebModule1: TWebModule1;
implementation
{$R *.dfm}
procedure TWebModule1.WebModule1DefaultHandlerAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
WSDLHTMLPublish1.ServiceInfo(Sender, Request, Response, Handled);
end;
end.
{####################################################################}
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, InvokeRegistry, StdCtrls, Rio, SOAPHTTPClient;
type
TForm1 = class(TForm)
HTTPRIO1: THTTPRIO;
Edit2: TEdit;
Edit3: TEdit;
Label2: TLabel;
Label3: TLabel;
Button2: TButton;
Label4: TLabel;
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses convertIntf, mainmenu;
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
var
temp: iconvert;
i: Integer;
begin
Form1.Visible := False;
temp := httprio1 as iconvert;
if temp.login(edit2.Text, edit3.Text) then label4.Caption := 'Login'
else
label4.Caption := 'Failed!';
// 1-admin 2- change drug,chage curr,insert drug,change price 3-iuser,uuser,current 4-change current
i := StrToInt(temp.curruserlimit(edit2.Text));
FORM2.Label1.Caption := temp.currusernam(edit2.Text);
FORM2.Label2.Caption := temp.curruserfam(edit2.Text);
FORM2.Label3.Caption := temp.curruseraddr(edit2.Text);
FORM2.Label4.Caption := temp.currusertel(edit2.Text);
case i of
1:
begin
form2.iuser.Enabled := True;
form2.uuser.Enabled := True;
form2.curruser.Enabled := True;
form2.udrug.Enabled := True;
form2.idrug.Enabled := True;
form2.rundat.Enabled := True;
form2.Button7.Enabled := True;
form2.Show;
end;
2:
begin
form2.iuser.Enabled := False;
form2.uuser.Enabled := False;
form2.curruser.Enabled := True;
form2.udrug.Enabled := True;
form2.idrug.Enabled := True;
form2.rundat.Enabled := True;
form2.Button7.Enabled := True;
form2.Show;
end;
3:
begin
form2.iuser.Enabled := True;
form2.uuser.Enabled := True;
form2.curruser.Enabled := True;
form2.udrug.Enabled := False;
form2.idrug.Enabled := False;
form2.rundat.Enabled := False;
form2.Button7.Enabled := True;
form2.Show;
end;
4:
begin
form2.iuser.Enabled := False;
form2.uuser.Enabled := False;
form2.curruser.Enabled := True;
form2.udrug.Enabled := False;
form2.idrug.Enabled := False;
form2.rundat.Enabled := False;
form2.Button7.Enabled := True;
form2.Show;
end;
else
begin
ShowMessage('Access Denided!');
halt;
end;
end;//case
end;
end.
{####################################################################}
unit adduser;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, InvokeRegistry, Rio, SOAPHTTPClient;
type
TForm3 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
ComboBox1: TComboBox;
Edit7: TEdit;
Button1: TButton;
Button2: TButton;
HTTPRIO1: THTTPRIO;
procedure Button1Click(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
uses convertIntf;
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
var
temp: iconvert;
begin
temp := httprio1 as iconvert;
if temp.currusernam(edit1.Text) = 'Not found!' then button2.Enabled := True
else
button2.Enabled := False;
end;
procedure TForm3.Edit1Change(Sender: TObject);
begin
button2.Enabled := False;
button1.Enabled := True;
end;
procedure TForm3.Button2Click(Sender: TObject);
var
temp: iconvert;
s: string;
begin
temp := httprio1 as iconvert;
s := ' N''' + edit1.Text + ''',N''' + edit2.Text + ''',' +
IntToStr(combobox1.ItemIndex) + ',N''' + edit3.Text + ''',N''' +
edit4.Text + ''',N''' + edit5.Text + ''',N''' + edit6.Text + ''',' + edit7.Text + ' ';
if temp.LOGINinsert(s) then
begin
ShowMessage('saved');
edit1.Text := '';
edit2.Text := '';
edit3.Text := '';
edit4.Text := '';
edit5.Text := '';
edit6.Text := '';
edit7.Text := '';
combobox1.ItemIndex := 0;
button2.Enabled := False;
end
else
begin
ShowMessage('Not saved!');
button2.Enabled := False;
end;
end;
end.