Syntax
Function CreateGroup(ParentID As Integer, Name As String, Username As String, Password As String, ReadOnlyLogin As Boolean, Phone As String, Fax As String, Mobile As String, TelPWD As String, POB As String, Email As String, Address As String, ChangePW as Boolean) As String
Description
The CreateGroup operation is used to create a new group under a specific given parent Integer.
Request Parameters
Name |
Description |
Required |
ParentID |
- Parent Identifier which the new group will be under it
- Type :Integer
- Default : None
- Constraints : Must be valid parent ID and accessible by logged in dealer
|
Yes
|
Name |
- Group description.
- Type : String
- Default : None
|
Yes
|
Username |
- Group username.
- Type : String.
- Default : None
|
Yes
|
Password |
- Group password.
- Type : String.
- Default : None
|
Yes
|
ReadOnlyLogin |
- To indicate if the Group will only monitor the trades or not
- Type: Boolean
- Default : None
|
Yes
|
Phone |
- Group phone number
- Type : String.
- Default : None
|
Yes
|
Fax |
- Group Fax number
- Type : String
- Default : None
|
Yes
|
Mobile |
- Group mobile number
- Type : String
|
Yes
|
TelPWD
|
- Group Telephone password number
- Type : String
- Default : None
|
Yes
|
POB |
- Post office box
- Type : String
- Default : None
|
Yes
|
Email |
- Group Email address
- Type : String
- Default : None
|
Yes
|
Address |
- Group Address
- Type : String
- Default : None
|
Yes
|
ChangePW |
- To indicate if the group will force to change the password after the first login or not
- Type : Boolean
- Default : None
|
Yes
|
Response Elements
Name |
Description |
Result |
The operation returns new group 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>CreateGroup</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 + ')');
$("#resultData").html(dataResult);
if (dataResult > 0) {
$("#resultData").html("SuccessResult ... GroupID is :" + dataResult)
}
else {
var errDetail = "https://support.hybridsolutions.com//index.php?/Knowledgebase/Article/View/4603"
$("#resultData").html("Error Code : " + dataResult + "<br/>" + " for more details see the follwing link: " + errDetail.link(errDetail));
}
}
$("#btnAction").click(function () {
$.getJSON(urlStr + "/CreateGroup?ParentID=" + $("#txtParentID").val() + "&Name=" + $("#txtName").val() + "&Username=" + $("#txtUser").val() + "&Password=" + $("#txtPass").val() + "&ReadOnlyLogin=" + $("#txtReadOnlyLogin").val() + "&Phone=" + $("#txtPhone").val() + "&Fax=" + $("#txtFax").val()+ "&Mobile=" + $("#txtMobile").val() + "&TelPWD=" + $("#txtTelPWD").val() + "&POB=" + $("#txtPOB").val() + "&Email=" + $("#txtEmail").val() + "&Address=" + $("#txtAddress").val() + "&ChangePW=" + $("#txtForceChangePass").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>
ParentID: <input type="text" id="txtParentID" value=""/>
Name: <input type="text" id="txtName" value=""/>
Username: <input type="text" id="txtUser" value=""/>
</td>
</tr>
<tr>
<td>
Password: <input type="text" id="txtPass" value=""/>
ReadOnlyLogin: <input type="text" id="txtReadOnlyLogin" value=""/>
Phone: <input type="text" id="txtPhone" value=""/>
</td>
</tr>
<tr>
<td>
Fax: <input type="text" id="txtFax" value=""/>
Mobile: <input type="text" id="txtMobile" value=""/>
TelPWD: <input type="text" id="txtTelPWD" value=""/>
</td>
</tr>
<tr>
<td>
POB: <input type="text" id="txtPOB" value=""/>
Email: <input type="text" id="txtEmail" value=""/>
Address: <input type="text" id="txtAddress" value=""/>
</td>
</tr>
<tr>
<td>
ForceChangePass: <input type="text" id="txtForceChangePass" value=""/>
<button id="btnAction"> CreateGroup </button>
</td>
</tr>
</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
|