Пример #1
0
        public IActionResult Index(int pageIndex = 1, string Keyword = "", DateTime?searchTime = null)
        {
            var State = ds.FindList(x => x.ParentId == (int)EnumList.State).ToList();

            ViewData["State"]      = State;
            searchTime             = searchTime ?? DateTime.Now.Date;
            ViewData["OrderTime"]  = ((DateTime)searchTime).ToString("yyyy-MM-dd");
            ViewData["PoolType"]   = ds.GetPoolTypeAll();
            ViewData["CourseType"] = ds.FindList(x => x.ParentId == (int)EnumList.CourseType).ToList();
            User curUser = um.FindByIdAsync(AbpSession.UserId.ToString()).Result;
            var  q       = cos.GetCustomerOrder(pageIndex, Keyword, searchTime, curUser.Location, curUser.ParentID);

            q.ForEach(x =>
            {
                x.Customer          = cs.Find(y => y.Id == x.CustomerId);
                x.Coach             = um.GetUserById(x.CoachId ?? 1);
                x.ResponsiblePerson = um.GetUserById(x.ResponsiblePersonId ?? 1);
            });

            return(View(q));
        }