CreateOffice
Posted by Angham Al-Banawien, Last modified by Diab Mansour on 15 July 2021 01:56 PM

 Syntax

 Function CreateOffice(ParentID As Integer, Name As String, Username As String, Password As String, IsDemo As Boolean, ReadOnly As Boolean, Phone As String, Fax As String, Mobile As String, TelFax As String, POB As String, Email As String, Address As String, ForceChangePassword as boolean) As String

Description

The CreateOffice operation is used to create new client of type office under a specific given parent name.

Request Parameters

Name Description  Required
 ParentID
  • Parent ID which the new office will be under it
  • Type : Integer
  • Default : None
  • Constraints : Must be valid parent ID and accessible by logged in dealer

 

Yes

 Name
  • Office description.
  • Type : String
  • Default : None

 

 Yes

 Username
  • Office username.
  • Type : String.
  • Default : None

 

 Yes

 Password
  • Office password
  • Type : String.
  • Default : None

 

 Yes

 IsDemo
  • To indicate if the office is demo or not.
  • Type : String
  • Default : None

 

 Yes

 ReadOnly
  • To indicate if the client will only monitor the trades or not
  • Type: Boolean
  • Default : None

 

 Yes

 Phone
  • office phone number
  • Type : String.
  • Default : None

 

 Yes

 Fax
  • office Fax number
  • Type : String
  • Default : None

 

 Yes

 Mobile
  • office mobile number
  • Type : String

 

 Yes

 TelFax
  • Office TelFax number
  • Type : String
  • Default : None

 

 Yes

 POB
  • Post office box
  • Type : String
  • Default : None

 

 Yes

 Email
  • office Email address
  • Type : String
  • Default : None

 

 Yes

 Address
  • office Address
  • Type : String
  • Default : None

 

Yes

ForceChangePassword
  • To indicate if the office will have to change the password after the first login or not
  • Type : boolean
  •  

yes


Response Elements

Name Description 
 Result

The operation return new office identifier in case success, otherwise an explicit  error code is returned 


Sample

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CreateOffice</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script >
var hisTable;
$(document).ready(function () {
var urlStr = "http://173.249.35.43/webtrader/webservice.svc";
jQuery.support.cors = true;
$("#progress").ajaxStart(function () { $(this).css("display", "block"); });
$("#progress").ajaxComplete(function () { $(this).css("display", "none"); });
function onSuccessResult(response) {
response = eval('(' + response + ')')
if (response.UserId == -1 || response.UserId == -207) {
$("#resultData").html("Invalid username or password");
}
else if (response.UserId == -231) {
$("#resultData").html("You must have at least one account");
}
else if (response == null || response == "" || response.UserId < 0) {
$("#resultData").html("Error while login.Please try later");
}
else {
$("#resultData").html("SuccessResult ... UserId is :" + response.UserId);
}
}
$("#resultAction").ajaxError(function (result) { $(this).html('An error occured'); });
function onErrorResult(result) {
alert('Service call faild : ' + result.status + ' ' + result.statusText);
}
$("#btnLogin").click(function () {
$.getJSON(urlStr + "/BackofficeLogin?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?" , onSuccessResult);
});
function onSuccessResultAction(dataResult) {
dataResult = eval('(' + dataResult + ')');
$("#resultAction").html(dataResult);
if (dataResult > 0) {
$("#resultAction").html("SuccessResult ... OfficeID is :" + dataResult);
}
else {
var errDetail = "https://support.hybridsolutions.com//index.php?/Knowledgebase/Article/View/1964"
$("#resultAction").html("Error Code : " + dataResult + "<br/>" + " for more details see the follwing link: " + errDetail.link(errDetail));
}

}
$("#btnAction").click(function () {
$.getJSON(urlStr + "/CreateOffice?ParentID=" + $("#txtParentID").val() + "&Name=" + $("#txtName").val() + "&Username=" + $("#txtUser").val() + "&Password=" + $("#txtPass").val() + "&IsDemo=" + $("#txtIsDemo").val() + "&ReadOnly=" + $("#txtReadOnly").val()+ "&Phone=" + $("#txtPhone").val() + "&Fax=" + $("#txtFax").val() + "&Mobile=" + $("#txtMobile").val() + "&TelPWD=" + $("#txtTelPW").val() + "&POB=" + $("#txtPOB").val() + "&Email=" + $("#txtEmail").val() + "&Address=" + $("#txtAddress").val()+ "&ForceChangePassword=" + $("#txtForceChangePassword").val() + "&callback=?" , onSuccessResultAction);
});
});
</script>

<body>
<table border="1px">
<tbody>
<tr>
<td>
Username: <input type="text" id="txtusername" value=""/>
Password: <input type="text" id="txtpassword" value=""/>
<button id="btnLogin"> Login </button>
</td>
</tr>
<tr>
<td>
Parent ID: <input type="text" id="txtParentID" value=""/>
Name: <input type="text" id="txtName" value=""/>
UserName: <input type="text" id="txtUser" value=""/>
</tr>
</td>
<tr>
<td>
Password <input type="text" id="txtPass" value=""/>
IsDemo <input type="text" id="txtIsDemo" value=""/>
Read Only <input type="text" id="txtReadOnly" value=""/>
Phone <input type="text" id="txtPhone" value=""/>
</tr>
</td>
<tr>
<td>
Fax <input type="text" id="txtFax" value=""/>
Mobile: <input type="text" id="txtMobile" value=""/>
TelPW: <input type="text" id="txtTelPW" value=""/>
POB <input type="text" id="txtPOB" value=""/>
</tr>
</td>
<tr>
<td>
Email: <input type="text" id="txtEmail" value=""/>
Address: <input type="text" id="txtAddress" value=""/>
ForceChangePassword: <input type="text" id="txtForceChangePassword" value=""/>
<button id="btnAction"> CreateOffice </button>
</tr>
</td>
</tbody>
</table>
<div id="resultData"> </div>
<div id="resultAction"> </div>
<div style="display:none" id="progress">Loading ... </div>
</body>
</html>

 


See Also


VertexFX Backoffice WCF Service Index

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions