Exemplo n.º 1
0
 public ActionResult Index()
 {
     var model = new MemberSearchViewModel();
     return View(model);
 }
Exemplo n.º 2
0
        public ActionResult getall(MemberSearchViewModel model, int page = 1, int rows = 10)
        {
            var query = MemberService.GetALL().Include(x => x.Department).Include(x => x.Group).Include(x => x.JobTitleCate);

            if (!string.IsNullOrEmpty(model.Member_SearchName))
            {
                query = query.Where(x => x.NickName.Contains(model.Member_SearchName));
            }

            var count = query.Count();

            var data = query.Select(x => new MemberListViewModel()
            {
                MemberID = x.MemberID,

                MemberType = x.MemberType,

                Mobile = x.Mobile,

                Mobile1 = x.Mobile1,

                Email = x.Email,

                NickName = x.NickName,

                AvtarUrl = x.AvtarUrl,

                GroupID = x.GroupID,

                GroupName = x.Group.Name,

                DepartmentID = x.DepartmentID,

                DepartmentName = x.Department.Name,

                JobTitleID = x.JobTitleID,

                JobTitleName = x.JobTitleCate.CateName,

                IsLeader = x.IsLeader,

                LastTime = x.LastTime,

                LastIP = x.LastIP,

                AddTime = x.AddTime,

                OpenType = x.OpenType,

                OpenID = x.OpenID,

                AddIP = x.AddIP,

                LoginCount = x.LoginCount,

                Status = x.Status,

                Sex = x.Sex,

                AddBirthDay = x.AddBirthDay,

                IsLeap = x.IsLeap,

                BirthDay = x.BirthDay,

                BirthDay1 = x.BirthDay1,

                CityCode = x.CityCode,

                CityCodeValue = x.CityCodeValue,

                RealName = x.RealName,

                Phone = x.Phone,

                QQ = x.QQ,

                MSN = x.MSN,

                Address = x.Address,

                Lat = x.Lat,

                Lng = x.Lng,

                Description = x.Description,

                IDNumber = x.IDNumber,

                JobExp = x.JobExp,

                StudyExp = x.StudyExp,

                FamilySituation = x.FamilySituation,

            })
            .OrderBy(x => x.MemberID)
            .Skip((page - 1) * rows)
            .Take(rows).ToList();

            var obj = new
            {
                rows = data,
                total = count
            };
            return Json(obj);
        }