public ActionResult DeleteUser(string ProfileId, string UserId) { //BE.ERetorno objDbResult = null; JSonResult objResult = new JSonResult(); try { BE.MProfileUser MProfileUsers = new BE.MProfileUser(); MProfileUsers.ProfileId = ProfileId.ToInt32(); MProfileUsers.UserId = UserId.ToInt32(); string response = string.Empty; response = new WebApiProfile().DeleteUsersProfile(MProfileUsers); string statusCode = response.Split('|')[0]; string statusMessage = response.Split('|')[1]; string MessageResul = string.Format(MessageResource.SaveSuccess, "User Profile"); objResult.isError = statusCode.Equals("2") ? true : false; objResult.message = statusCode.Equals("2") ? statusMessage : MessageResul; } catch (Exception ex) { objResult.data = null; objResult.isError = true; objResult.message = MessageResource.ControllerDeleteExceptionMessage; } return(Json(objResult)); }
public JsonResult SearchUserProfile(SearchUserProfileViewModel model) { JSonResult objResult = new JSonResult(); //BE.EPerfilUsuarios objEntParam; try { BE.MProfileUser MProfile = new BE.MProfileUser(); MProfile.ProfileId = model.ProfileId; MProfile.User = Extension.ToEmpty(model.User); MProfile.Name = Extension.ToEmpty(model.Name); objResult.data = new WebApiProfile().GetUsersUnAssigned(MProfile).Select(x => new ResultSearchUserProfileViewModelViewModel { ProfileId = model.ProfileId, UserId = x.UserId, User = x.User, Name = x.Name }).ToList(); } catch (Exception ex) { objResult.data = null; objResult.isError = true; objResult.message = string.Format(MessageResource.ControllerGetExceptionMessage, "Users"); } return(Json(objResult)); }