public string NoSelectSaveRoleFunctionSetting(RoleVO roleVO)
        {
            string result = string.Empty;

            //處理清空所有check時的行為
            result = _functionService.ClearRoleFunctionByRoleID(roleVO.RoleID.ToString());

            return(result);
        }
Example #2
0
        public ActionResult SaveRoleFunctionSetting(IEnumerable <FunctionCheckVO> functionCheckVO, string roleID = null)
        {
            string result = string.Empty;

            if (roleID == null)
            {
                //處理有關選時的行為
                result = _functionService.SaveRoleFunctionSetting(functionCheckVO);

                if (!string.IsNullOrEmpty(result))
                {
                    CurrentHttpContext.Response.StatusCode = (int)HttpStatusCode.BadRequest;
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    CurrentHttpContext.Response.StatusCode = (int)HttpStatusCode.OK;
                }
            }
            else
            {
                //處理清空所有check時的行為
                result = _functionService.ClearRoleFunctionByRoleID(roleID);

                if (!string.IsNullOrEmpty(result))
                {
                    CurrentHttpContext.Response.StatusCode = (int)HttpStatusCode.BadRequest;
                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    CurrentHttpContext.Response.StatusCode = (int)HttpStatusCode.OK;
                }
            }
            SessionReflash();
            return(Json(result, JsonRequestBehavior.AllowGet));
        }