Example #1
0
        public Response <string> Block([FromBody] UserBlockVM block)
        {
            var service = new Services.Users.UserService(Context, CurrentAdmin);
            var success = service.Block(block);

            return(new Response <string>(success ? "Successful" : "Failed", !success));
        }
Example #2
0
        public Response <string> RemoveRole([FromBody] RoleUpdate roleUpdate)
        {
            var service = new Services.Users.UserService(Context, CurrentAdmin);
            var success = service.RemoveRole(roleUpdate.UserId, roleUpdate.Name);

            return(new Response <string>(success ? "Successful" : "Failed", !success));
        }
Example #3
0
        public Response <UserVM> Post([FromBody] UserVM value)
        {
            var userService = new Services.Users.UserService(Context, CurrentUser);

            userService.SaveUser(value);

            var profService = new Services.Users.ProfileService(Context, CurrentUser);

            profService.SaveProfile(value.Profile);

            var langService = new Services.Localization.UserLanguageService(Context, CurrentUser);

            langService.SaveUserLanguages(value.UserId, value.Languages);

            LogService.Write("Saved profile", value.UserId.ToString());
            return(new Response <UserVM>(value));
        }
Example #4
0
        public Response <UserVM> Search(string searchText)
        {
            var service = new Services.Users.UserService(Context, CurrentAdmin);

            return(new Response <UserVM>(service.Search(searchText)));
        }