Example #1
0
        public string CreateUser(string username, string pw)
        {
            ApiResult result = new ApiResult();

            _logger.Information("START PasswordController.CreateUser: "******"",
                    sAMAccountName    = username,
                    name            = "",
                    sn              = "Bao",
                    givenName       = "Nguyen Xuan",
                    displayName     = "Nguyen Xuan Bao",
                    mail            = "",
                    telephoneNumber = "0912345678",
                    department      = "Ban Cong Nghe",
                    title           = "Giám đốc",
                    employeeID      = "VP-291",
                    description     = "Tạo từ tool thần thánh"
                };

                var obj = _passwordChangeProvider.CreateAdUser(user, pw);
                if (obj != null)
                {
                    result.Payload = obj;
                    result.Errors.Add(new ApiErrorItem(ApiErrorCode.Generic, "Successful"));
                }
                else
                {
                    result.Errors.Add(new ApiErrorItem(ApiErrorCode.UserNotFound, "Không xác định được user."));
                }
            }
            catch (Exception e)
            {
                result.Errors.Add(new ApiErrorItem(ApiErrorCode.UserNotFound, "Không xác định được user. Lỗi: " + e.Message));
            }

            return(JsonConvert.SerializeObject(result));
        }
 public ApiResultAd CreateAdUser(UserInfoAd user, string pw)
 {
     throw new NotImplementedException();
 }