コード例 #1
0
        public JsonResult RolesAssignUpdate(OrgRolesForm model)
        {
            model.inputUser = AppBusiness.loginModel.UserNo;
            JsonResponses responses = assignSDK.CreateOrgRoles(model);

            return(Json(responses, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        /// <summary>
        /// 机构角色修改
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int OrgRolesInsert(OrgRolesForm model)
        {
            int result = 0;

            //删除原有权限
            DataHandleManager.Instance().PsOrgRolesHandle.DeleteOrgRoles(model.OrgNo);
            PsOrgRoles orgRoles = null;

            if (model.RolesNos != null)
            {
                foreach (var nos in model.RolesNos)
                {
                    PsRoles roles = DataHandleManager.Instance().PsRolesHandle.GetRolesInfo(nos);
                    if (roles != null)
                    {
                        orgRoles = new PsOrgRoles()
                        {
                            RolesNo    = nos,
                            OrgNo      = model.OrgNo,
                            InputUser  = model.InputUser,
                            InputTime  = DateTime.Now,
                            UpdateTime = DateTime.Now
                        };
                        result += DataHandleManager.Instance().PsOrgRolesHandle.Insert(orgRoles);
                    }
                }
            }
            return(result);
        }
コード例 #3
0
        public ActionResult <JsonResponses> CreateOrgRoles([FromBody] OrgRolesForm model)
        {
            var ResultCode = -1;

            DataHandleManager.Instance().PsOrganizationHandle.CheckOrgNoIsExist(model.orgNo);
            if (model.rolesNos != null)
            {
                DataHandleManager.Instance().PsRolesHandle.CheckRolesNosIsExist(model.rolesNos.ToList());
            }
            ResultCode = DataHandleManager.Instance().PsOrgRolesHandle.OrgRolesInsert(model);
            return(ResultCode > 0 ? JsonResponses.Success : JsonResponses.Failed);
        }
コード例 #4
0
ファイル: AssignSDK.cs プロジェクト: 0582zyj/SkeFramework
 /// <summary>
 /// 机构角色授权
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public JsonResponses CreateOrgRoles(OrgRolesForm model)
 {
     try
     {
         RequestBase request = RequestBase.PostJson as RequestBase;
         request.Url = CreateOrgRolesUrl;
         request.SetJsonValue(model);
         return(sdkUtil.PostForVo(request));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
     return(JsonResponses.Failed);
 }
コード例 #5
0
        public JsonResult RolesAssignUpdate(OrgRolesForm model)
        {
            JsonResponses responses = assignSDK.CreateOrgRoles(model);

            return(Json(responses, JsonRequestBehavior.AllowGet));
        }