Knowledgebase:
CreateDemoAccount
Posted by Mohammad Rahhal, Last modified by Rawan Al Hourani on 13 February 2018 09:54 AM

Syntax 

CreateDemoAccount ( fname As String, tel As String , email As String , address As String , deposit As Double , country As String , IPAddress As String )

Description

The CreateDemoAccount operation is used to generate a new account for demonstration.

Request Parameters

Name Description  Required

fname

  • The user First name.
  • Type: String.
  • Default: None.
  • Constraints: No constraints.
Yes

tel

  • The user phone number.
  • Type: String.
  • Default: None.
  • Constraints: Must be a valid phone number with area code.
Yes

email

  • The user email address.
  • Type: string.
  • Default: None.
  • Constraints: Must be a valid Mail address to receive the password.
No

address

  • The user address.
  • Type: String.
  • Default: None.
  • Constraints: No constraints.
No

deposit

  • The begin Balance.
  • Type: Double.
  • Default: None.
  • Constraints: Must be Numeric.
Yes

country

  • The user country.
  • Type: Sring.
  • Default: None.
  • Constraints: No constraints.
No

IPAddress

  • Client IP Address.
  • Type: String.
  • Default: None.
  • Constraints: No constraints.
No

Response Elements

Name Description 
Result

The operation returns object of type ClientInformation , otherwise an explicit error code is returned if Username is less than 0 . 

The Following are the ClientInformation data member

  • ClientID : Client number
  • ParentID : parent number which the client belongs to 
  • Username : client username
  • FirstName : client first name
  • SecondName : client second name.
  • ThirdName : client third name
  • LastName : client last          
  • Phone : client phone number
  • Email : client Email
  • Address : client 
  • Country : client Country
  • Mobile : client Mobile
  • TelFax : client TelFax
  • Pop : Client pop
  • Fax : client Fax
  • Demo : Boolean value that detects if client is demo or not
  • Read_Only : Boolean value that detects if client is read-only or not
  • ClientType (1 = client type , 2 = Office Type, 3 Group Type)

Sample

Download sample as text file.

 

<!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>CreateDemoAccount</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script type="text/javascript" >
$(document).ready(function () {
var urlStr = "http://5.10.64.199/vertexweb10/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);
}
$("#btnAction").click(function () {
$.getJSON(urlStr + "/CreateDemoAccount?fname=" + $("#txtfname").val() + "&tel=" + $("#txttel").val() + "&email=" + $("#txtemail").val() + "&address=" + $("#txtaddress").val() + "&deposit=" + $("#txtdeposit").val() + "&country=" + $("#txtcountry").val() + "&IPAddress=" + $("#txtIPAddress").val() + "&callback=?" , onSuccessResultOrder);
function onSuccessResultOrder(dataResult) {
var rst = "";
var result = eval('(' + dataResult + ')');
if (result.UserName == "WAITDEMO") {
rst = "Could not create Demo account at this time, Please try again later"
}
else if (result.UserName == "ERRDEMO") {
rst = "Could not create Demo account at this time, Please Check your data or try again later";
}
else {
rst = "UserName is : " + result.UserName + "<br/>"
rst += "Password is : " + result.Password + "<br/>"
rst += "Phone is : " + result.Phone + "<br/>"
rst += "Email is : " + result.Email + "<br/>"
rst += "Address is : " + result.Address + "<br/>"
rst += "Country is : " + result.Country + "<br/>"
rst += "First name is : " + result.FirstName + "<br/>"
rst += "client Id is : " + result.ClientID + "<br/>"
rst += "Password was sent to your email:";
}
$("#resultAction").html(rst);
}
});
});
</script>
<body>
<table border="1px">
<tbody>
<tr>
<td>fname:<input type="text" id="txtfname" value=""/>
tel: <input type="text" id="txttel" value=""/>
</td>
</tr>
<tr>
<td>email:<input type="text" id="txtemail" value=""/>
address: <input type="text" id="txtaddress" value=""/>
</td>
</tr>
<tr>
<td>deposit:<input type="text" id="txtdeposit" value=""/>
country: <input type="text" id="txtcountry" value=""/>
IPAddress:<input type="text" id="txtIPAddress" value=""/>
</td>
</tr>
<tr>
<td><button id="btnAction"> CreateDemoAccount </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 WCF Service Index

(5 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