예제 #1
0
 public ActionResult Index(int ID)
 {
     var model = new PlanLogSearchViewModel()
     {
         ID = ID
     };
     return PartialView(model);
 }
예제 #2
0
        public ActionResult getall(PlanLogSearchViewModel model, int page = 1, int rows = 10)
        {
            var query = PlanLogService.GetALL().Include(x => x.AddMember);

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

            var count = query.Count();

            var data = query.Select(x => new PlanLogListViewModel()
            {
                ID = x.ID,

                CompanyID = x.CompanyID,

                AddTime = x.AddTime,

                PlanTime = x.PlanTime,

                Content = x.Content,

                Comment = x.Comment,

                CommentTitme = x.CommentTitme,

                AddUser = x.AddUser,

                AddUserName = x.AddMember.NickName

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

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