Commit 6d65b61f by cam

realized most of my changes werent properly saved.

parent 8c76b8c5
...@@ -113,7 +113,7 @@ var ...@@ -113,7 +113,7 @@ var
xdcResponse: TXDataClientResponse; xdcResponse: TXDataClientResponse;
responseString: TJSObject; responseString: TJSObject;
begin begin
userInfo := '&username=' + Username + userInfo := '&username=' + edtUsername.Text +
'&fullname=' + edtFullName.Text + '&fullname=' + edtFullName.Text +
'&password=' + edtPassword.Text + '&password=' + edtPassword.Text +
'&status=' + BoolToStr(cbStatus.Checked) + '&status=' + BoolToStr(cbStatus.Checked) +
......
...@@ -62,14 +62,14 @@ object FViewMain: TFViewMain ...@@ -62,14 +62,14 @@ object FViewMain: TFViewMain
object lblCallsList: TWebLinkLabel object lblCallsList: TWebLinkLabel
Left = 564 Left = 564
Top = 56 Top = 56
Width = 25 Width = 29
Height = 15 Height = 15
ElementID = 'dropdown.menu.callslist' ElementID = 'dropdown.menu.callslist'
ElementFont = efCSS ElementFont = efCSS
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnClick = lblCallsListClick OnClick = lblCallsListClick
Caption = 'Calls' Caption = 'Items'
end end
object lblUsers: TWebLinkLabel object lblUsers: TWebLinkLabel
Left = 561 Left = 561
......
...@@ -93,6 +93,7 @@ type ...@@ -93,6 +93,7 @@ type
[HttpGet] function GetUsers(searchOptions: string): TUserList; [HttpGet] function GetUsers(searchOptions: string): TUserList;
[HttpGet] function GetItems(searchOptions: string): TItemList; [HttpGet] function GetItems(searchOptions: string): TItemList;
function AddUser(userInfo: string): string; function AddUser(userInfo: string): string;
function AddItem(itemInfo: string): string;
function DelUser(username: string): string; function DelUser(username: string): string;
function EditUser(const editOptions: string): string; function EditUser(const editOptions: string): string;
end; end;
......
...@@ -27,6 +27,7 @@ type ...@@ -27,6 +27,7 @@ type
function EditUser(const editOptions: string): string; function EditUser(const editOptions: string): string;
function Search(phoneNum: string): TCallList; function Search(phoneNum: string): TCallList;
function AddUser(userInfo: string): string; function AddUser(userInfo: string): string;
function AddItem(itemInfo: string): string;
function DelUser(username: string): string; function DelUser(username: string): string;
procedure AfterConstruction; override; procedure AfterConstruction; override;
procedure BeforeDestruction; override; procedure BeforeDestruction; override;
...@@ -447,10 +448,48 @@ begin ...@@ -447,10 +448,48 @@ begin
Result := 'Failure:Username already taken'; Result := 'Failure:Username already taken';
end; end;
function TLookupService.DelUser(username: string): string; function TLookupService.AddItem(itemInfo: string): string;
var var
params: TStringList;
Name: string;
Description: string;
Status: boolean;
SQL: string; SQL: string;
begin
params := TStringList.Create;
params.StrictDelimiter := true;
// parse the searchOptions
params.Delimiter := '&';
params.DelimitedText := itemInfo;
Name := params.Values['name'];
Description := params.Values['description'];
Status := StrToBool(params.Values['status']);
SQL := 'select * from qb_items where qb_item_name = ' + QuotedStr(Name);
doQuery(callsDB.UniQuery1, SQL);
if callsDB.UniQuery1.IsEmpty then
begin
callsDB.UniQuery1.FieldByName('qb_item_name').AsString := Name;
callsDB.UniQuery1.FieldByName('item_desc').AsString := Description;
if Status then
callsDB.UniQuery1.FieldByName('status').AsString := 'ACTIVE'
else
callsDB.UniQuery1.FieldByName('status').AsString := 'INACTIVE';
callsDB.UniQuery1.Post;
Result := 'Success:Item successfully added';
end
else
Result := 'Failure: Item already exists';
end;
function TLookupService.DelUser(username: string): string;
var
SQL: string;
params: TStringList;
begin begin
SQL := 'select * from users where username = ' + QuotedStr(username.toLower); SQL := 'select * from users where username = ' + QuotedStr(username.toLower);
callsDB.UniQuery1.Close; callsDB.UniQuery1.Close;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment