예제 #1
0
 public ActionResult TongJi(int page = 1, string Keyword = "",
     string StartTime = "", string EndTime = "")
 {
     ActivitysViewModel model = new ActivitysViewModel();
     try
     {
         ActivityService service = new ActivityService();
         QueryActivityCriteria queryActivityCriteria = new QueryActivityCriteria
         {
             PageSize = 35,
             StartRowIndex = page,
             QueryType = 7,
             Keyword = Keyword,
             StartTime = string.IsNullOrWhiteSpace(StartTime) ? new DateTime(2014,1,1) : Convert.ToDateTime(StartTime),
             EndTime = string.IsNullOrWhiteSpace(EndTime) ? DateTime.Now : Convert.ToDateTime(EndTime)
         };
         model.ActivityList = service.QueryActivities(queryActivityCriteria);
         if (model.ActivityList != null)
         {
             model.TotalCount =
                 queryActivityCriteria.ResultTotalCount;
         }
         model.StartTime = queryActivityCriteria.StartTime.Value;
         model.EndTime = queryActivityCriteria.EndTime.Value;
         model.PageSize = queryActivityCriteria.PageSize;
         model.PageIndex = queryActivityCriteria.StartRowIndex;
         model.PageStep = 5;
         model.ActivityTypes = (new ActivityTypeManager()).GetAllActivityTypes();
     }
     catch (Exception e)
     {
         LogService.Log("Activitys TongJi 出错了!", e.ToString());
     }
     return View(model);
 }
예제 #2
0
        //
        // GET: /M/Activity/
        public ActionResult Index(int page = 1)
        {
            ActivitysViewModel model = new ActivitysViewModel();
            try
            {
                ActivityService service = new ActivityService();
                QueryActivityCriteria queryActivityCriteria = new QueryActivityCriteria
                {
                    PageSize = 10,
                    StartRowIndex = page,
                    QueryType = -1
                };
                model.ActivityList = service.QueryActivities(queryActivityCriteria);

                if (model.ActivityList != null)
                {
                    model.TotalCount =
                        queryActivityCriteria.ResultTotalCount;
                }
                model.PageSize = 10;
                model.PageStep = 5;
                model.PageIndex = page;

                model.ActivityTypes = (new ActivityTypeManager()).GetAllActivityTypes();
            }
            catch (Exception e)
            {
                LogService.Log("Activitys List 出错了!", e.ToString());
            }
            return View(model);
        }
예제 #3
0
 public ActionResult Index(int page = 1, string Status="")
 {
     ActivitysViewModel model = new ActivitysViewModel();
     try
     {
         ActivityService service = new ActivityService();
         QueryActivityCriteria queryActivityCriteria = new QueryActivityCriteria
         {
             PageSize = 35,
             StartRowIndex = page,
             QueryType = 5,
             Status = string.IsNullOrEmpty(Status) ? "0,2,3,4":Status
         };
         model.ActivityList = service.QueryActivities(queryActivityCriteria);
         if (model.ActivityList != null)
         {
             model.TotalCount =
                 queryActivityCriteria.ResultTotalCount;
         }
         model.PageSize = queryActivityCriteria.PageSize;
         model.PageIndex = queryActivityCriteria.StartRowIndex;
         model.PageStep = 5;
         model.ActivityTypes = (new ActivityTypeManager()).GetAllActivityTypes();
     }
     catch (Exception e)
     {
         LogService.Log("Activitys List 出错了!", e.ToString());
     }
     ViewBag.Status = Status;
     return View(model);
 }