Beispiel #1
0
        public static User Create(UserResponse response)
        {
            if (response == null)
                return null;

            User user = new User();
            user.UserID = response.UserID;
            user.Username = response.Username;
            user.Password = response.Password;
            user.IsPasswordChanged = response.IsPasswordChanged;
            user.Language = response.Language;
            user.Type = response.Type;

            return user;

        }
Beispiel #2
0
        public JsonResult Get(int id)
        {
            UserResponse response = null;

            User user = db.Users.Where(x => x.UserID == id).FirstOrDefault();

            if (user != null)
            {
                response = new UserResponse();
                response.UserID = user.UserID;
                response.Username = user.Username;
                response.Language = user.Language;
                response.IsPasswordChanged = user.IsPasswordChanged == 'Y';
                if (!response.IsPasswordChanged)
                    response.Password = user.Password;
                response.Type = user.Type;
            }

            return Json(response, JsonRequestBehavior.AllowGet);
        }
Beispiel #3
0
        public ActionResult AddUser(UserResponse model)
        {
            CreateUserRequest request = new CreateUserRequest();
            request.UserID = model.UserID;
            request.Username = model.Username;
            request.Type = model.Type;


            var result = ApiWrapper.Post<bool>("api/user/add", request);

            if (string.IsNullOrEmpty(Request.QueryString["returnurl"]))
                return Redirect("/");
            else
                return Redirect(Request.QueryString["returnurl"]);
        }
Beispiel #4
0
        public JsonResult AddedUser(UserResponse model)
        {
            CreateUserRequest request = new CreateUserRequest();
            request.UserID = model.UserID;
            request.Username = model.Username;
            request.Type = model.Type;


            var result = ApiWrapper.Post<bool>("api/user/add", request);

            return Json(result);
        }