public void Edit(dynamic data)
 {
     var wrappers = RequestWrapper.InstanceArray(1);
     wrappers[0].SetJson("{table:'sys_user',where:[{column:'UserCode'}]}");
     var service = new sys_userService();
     var result = service.Edit(data, null, wrappers);
 }
Beispiel #2
0
        public ActionResult Index(LoginViewModel model, string returnUrl)
        {
            if (!ModelState.IsValid)
            {
                return(PartialView(model));
            }

            var service = new sys_userService();
            var loginer = service.LoginCheck(model.usercode, model.password);

            if (loginer == null)
            {
                ModelState.AddModelError("", "用户名称或密码错误"); return(PartialView(model));
            }
            if (!loginer.IsEnable)
            {
                ModelState.AddModelError("", "该用户已被禁用"); return(PartialView(model));
            }

            int LoginEffectiveHours = Convert.ToInt32(AppConfig.Get("LoginEffectiveHours"));

            MUser <sys_user> .SignIn(loginer.UserName, loginer, 60 *LoginEffectiveHours);

            service.UpdateUserLoginCountAndDate(loginer);

            if (Url.IsLocalUrl(returnUrl))
            {
                return(Redirect(returnUrl));
            }
            return(Redirect("/Home"));
        }
 public virtual object ChangePassword(string passwordold, string passwordnew)
 {
     var message = new sys_userService().ChangePassword(passwordold, passwordnew);
     return string.IsNullOrEmpty(message) ? 
         new { status = "success", message = "修改成功" } : 
         new { status = "error", message = message };
 }
Beispiel #4
0
        public virtual object ChangePassword(string passwordold, string passwordnew)
        {
            var message = new sys_userService().ChangePassword(passwordold, passwordnew);

            return(string.IsNullOrEmpty(message) ?
                   new { status = "success", message = "修改成功" } :
                   new { status = "error", message = message });
        }
Beispiel #5
0
        public void Edit(dynamic data)
        {
            var wrappers = RequestWrapper.InstanceArray(1);

            wrappers[0].SetJson("{table:'sys_user',where:[{column:'UserCode'}]}");
            var service = new sys_userService();
            var result  = service.Edit(data, null, wrappers);
        }
 // POST api/sys/config
 public void Post([FromBody]JObject value)
 {
     if (value == null)
         throw new HttpResponseException(
             new HttpResponseMessage(HttpStatusCode.NotAcceptable) { Content = new StringContent("配置不可为空") });
   
     var service = new sys_userService();
     service.SaveCurrentUserSettings(value);
 }
Beispiel #7
0
        /// <summary>
        /// 修改权限
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Update(int id)
        {
            sys_user controlUser = new sys_userService().GetUserByUserId(id);

            //所有菜单集合
            ViewData["allList"] = new sys_rightService().GetAllRights();
            ViewData["curList"] = new sys_rightService().GetRightsByRoleId(controlUser.usr_role_id);
            return(View(controlUser));
        }
        public dynamic Get(RequestWrapper request) 
        {
            request.LoadSettingXmlString(@"
<settings defaultOrderBy='UserSeq'>
   <where>
        <field name='UserCode' cp='mapchild' extend='sys_userOrganizeMap,OrganizeCode,sys_organize' variable='OrganizeCode' ignoreEmpty='true'></field>
    </where>
</settings>");
            var service = new sys_userService();
            var result = service.GetModelListWithPaging(request.ToParamQuery());
            return result;
        }
        public void Edit(dynamic data)
        {
            var listWrapper = RequestWrapper.Instance().LoadSettingXmlString(@"
<settings>
    <table>sys_user</table>
    <where>
        <field name='UserCode' cp='equal'></field>
    </where>
</settings>");
            var service = new sys_userService();
            var result = service.Edit(null, listWrapper, data);
        }
Beispiel #10
0
 public void Edit(dynamic data)
 {
     var listWrapper = RequestWrapper.Instance().LoadSettingXmlString(@"
     <settings>
     <table>sys_user</table>
     <where>
     <field name='UserCode' cp='equal'></field>
     </where>
     </settings>");
     var service = new sys_userService();
     var result = service.Edit(null, listWrapper, data);
 }
Beispiel #11
0
 public dynamic Get(RequestWrapper request)
 {
     request.LoadSettingXmlString(@"
     <settings defaultOrderBy='UserSeq'>
        <where>
     <field name='UserCode' cp='mapchild' extend='sys_userOrganizeMap,OrganizeCode,sys_organize' variable='OrganizeCode' ignoreEmpty='true'></field>
     </where>
     </settings>");
     var service = new sys_userService();
     var result = service.GetModelListWithPaging(request.ToParamQuery());
     return result;
 }
        public dynamic Get(RequestWrapper request) 
        {
            request.SetXml(@"
<settings>
   <where>
        <c column='UserCode' symbol='mapchild' values='{OrganizeCode},sys_userOrganizeMap,OrganizeCode,sys_organize' ignore='empty'></c>
    </where>
    <orderby>UserSeq</orderby>
</settings>");
            var service = new sys_userService();
            var result = service.GetModelListWithPaging(request.ToParamQuery());
            return result;
        }
Beispiel #13
0
        public dynamic Get(RequestWrapper request)
        {
            request.SetXml(@"
<settings>
   <where>
        <c column='UserCode' symbol='mapchild' values='{OrganizeCode},sys_userOrganizeMap,OrganizeCode,sys_organize' ignore='empty'></c>
    </where>
    <orderby>UserSeq</orderby>
</settings>");
            var service = new sys_userService();
            var result  = service.GetModelListWithPaging(request.ToParamQuery());

            return(result);
        }
Beispiel #14
0
        // POST api/sys/config
        public void Post([FromBody] JObject value)
        {
            if (value == null)
            {
                throw new HttpResponseException(
                          new HttpResponseMessage(HttpStatusCode.NotAcceptable)
                {
                    Content = new StringContent("配置不可为空")
                });
            }

            var service = new sys_userService();

            service.SaveCurrentUserSettings(value);
        }
Beispiel #15
0
        public JsonResult DoAction(JObject request)
        {
            var message = new sys_userService().Login(request);

            return(Json(message, JsonRequestBehavior.DenyGet));
        }
Beispiel #16
0
        public dynamic GetRoleMembers(string id)
        {
            var result = new sys_userService().GetRoleMembers(id);

            return(result);
        }
 public void EditUserRoles(string id, dynamic data)
 {
     var service = new sys_userService();
     service.SaveUserRoles(id, data as JToken);
 }
 public int PostResetPassword(string id)
 {
     var service = new sys_userService();
     return service.ResetUserPassword(id);
 }
 public dynamic GetRoleWithUserCheck(string id)
 {
     var service = new sys_userService();
     return service.GetUserRole(id);
 }
Beispiel #20
0
 public int PostResetPassword(string id)
 {
     var service = new sys_userService();
     return service.ResetUserPassword(id);
 }
Beispiel #21
0
 public dynamic GetRoleWithUserCheck(string id)
 {
     var service = new sys_userService();
     return service.GetUserRole(id);
 }
Beispiel #22
0
        public object PostModifyPassword(string id)
        {
            var service = new sys_userService();

            return(service.ModifyUserPassword(id));
        }
Beispiel #23
0
        public int PostEditUserPassword(string id, string pwd)
        {
            var service = new sys_userService();

            return(service.EditUserPassword(id, pwd));
        }
 public dynamic GetRoleMembers(string id) 
 {
     var result = new sys_userService().GetRoleMembers(id);
     return result;
 }
Beispiel #25
0
        public dynamic GetOrganizeWithUserCheck(string id)
        {
            var service = new sys_userService();

            return(service.GetUserOrganize(id));
        }
 public JsonResult DoAction(JObject request)
 {
     var message = new sys_userService().Login(request);
     return Json(message, JsonRequestBehavior.DenyGet);
 }
Beispiel #27
0
 public void EditUserRoles(string id, dynamic data)
 {
     var service = new sys_userService();
     service.SaveUserRoles(id, data as JToken);
 }