Пример #1
0
        public ActionResult GetUserInfoList(string strID, string strName)
        {
            int pageIndex = Request["page"] != null?int.Parse(Request["page"]) : 1;

            int pageSize = Request["rows"] != null?int.Parse(Request["rows"]) : 5;

            int   totalCount;
            short delFlag = (short)DeleteEnumType.Normarl;
            int   nID     = BasePubfun.ConvertToInt32(strID, -1);

            System.Linq.Expressions.Expression <Func <USERINFO, bool> > whereLambda = c => c.DELFLAG == delFlag;
            if (nID >= 0)
            {
                whereLambda = whereLambda.And(c => c.ID == nID);
            }
            if (!string.IsNullOrEmpty(strName) && strName.Length >= 1)
            {
                whereLambda = whereLambda.And(c => c.UNAME.Contains(strName));
            }
            var userInfoList = UserInfoService.LoadPageEntities(pageIndex, pageSize, out totalCount,
                                                                whereLambda, c => c.ID, true);
            var temp = from u in userInfoList
                       select new
            {
                ID      = u.ID,
                UNAME   = u.UNAME,
                UPWD    = u.UPWD,
                REMARK  = u.REMARK,
                SUBTIME = u.SUBTIME
            };

            return(Json(new { rows = temp, total = totalCount, }, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public ActionResult IDExist(string IDVal)
        {
            int  nID     = BasePubfun.ConvertToInt32(IDVal);
            bool isExist = UserInfoService.LoadEntities(c => c.ID == nID).FirstOrDefault() != null;

            if (isExist)
            {
                return(Content("true"));
            }
            return(Content("false"));
        }