Ejemplo n.º 1
0
        public ActionResult AddUserRole(string roleid, string userid)
        {
            bool   _success = false;
            string _error   = "";

            try
            {
                if (!String.IsNullOrWhiteSpace(roleid) && !String.IsNullOrWhiteSpace(userid))
                {
                    _success = _userRoleService.AddUserRole(userid, roleid);
                }
            }
            catch (Exception e)
            {
                _success = false;
                Commons.Logger.GenerateError(e, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType, "roleid = " + roleid + " and userid = " + userid);
            }
            return(Json(new { Result = _success, Error = _error }));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 分配角色添加
 /// </summary>
 /// <param name="json"></param>
 /// <returns></returns>
 public JObject AddRoles(JObject json)
 {
     return(userRolesService.AddUserRole(json));
 }