Exemplo n.º 1
0
        public ActionResult RemoveUserFromAllGroups(DataSourceRequest command, UserGroupListModel model)
        {
            HttpSessionStateBase session = HttpContext.Session;

            if (_userGroupService.RemoveUserFromAllGroups(model.User_ID, Convert.ToInt32(session["UserID"])))
            {
                var gridModel = new DataSourceResult
                {
                    ExtraData = new UserGroupListModel
                    {
                        Message      = Message.OperationSuccessful,
                        MessageColor = "green",
                    },
                    Total = 1
                };
                return(Json(gridModel));
            }
            else
            {
                var gridModel = new DataSourceResult
                {
                    ExtraData = new UserGroupListModel
                    {
                        Message      = Message.OperationNotAllowed,
                        MessageColor = "red",
                    },
                    Total = 1
                };
                return(Json(gridModel));
            }
        }