Exemple #1
0
        public static bool UserCreate(string username, string pass, ref int userid)
        {
            var input = new UserCreateInput()
            {
                UserName = username,
                UserPass = pass,
            };
            var json    = JsonConvert.SerializeObject(input);

            string output = null;
            try
            {
                output = HttpReader.HttpPost(ApiDef.UserCreate, json);
            }
            catch (AggregateException)
            {
                return false;
            }

            var result  = JsonConvert.DeserializeObject<UserCreateOutput>(output);
            var issuccess = ResultStatus.IsSuccess(result.ResultStatus);
            if (issuccess)
            {
                userid = result.UserId;
            }
            return issuccess;
        }
Exemple #2
0
 public static int CreateUser(string username, string pass)
 {
     var usercreateinput = new UserCreateInput()
     {
         UserName = username,
         UserPass = pass,
     };
     var output              = usermodule.OnUserCreate(JsonConvert.SerializeObject(usercreateinput));
     var usercreateoutput    = JsonConvert.DeserializeObject<UserCreateOutput>(output);
     return usercreateoutput.UserId;
 }