Пример #1
0
        public JsonResult LikeWebMainPage1()
        {
            WebDataViewModel model = new WebDataViewModel();

            model.getWebdataDB();

            return(Json(model.WebDataList, "success"));
        }
Пример #2
0
        public ActionResult LikeWebAddPage()
        {
            WebDataViewModel model = new WebDataViewModel();

            model.getWebType();
            if (!string.IsNullOrEmpty(model.Message))
            {
                return(null);
            }
            return(View(model));
        }
Пример #3
0
 public ActionResult LikeWebAddPage(WebDataViewModel model)
 {
     /*WebDataDB model = new WebDataDB();
      * if (!string.IsNullOrEmpty(WebName) || !string.IsNullOrEmpty(WebType) || !string.IsNullOrEmpty(WebURL))
      * {
      *  string ErrorMessage = "";
      *  model.WebName = WebName;
      *  model.WebType = WebType;
      *  model.WebURL = WebURL;
      *  //ErrorMessage = model.addWebdataDB(WebName, WebType, WebURL);
      * }*/
     return(new RedirectResult("/LikeWeb/LikeWebMainPage"));
 }
Пример #4
0
        public ActionResult LikeWebModifyPage(string WebName)
        {
            ViewBag.Title = "編輯頁面";
            WebDataViewModel model = new WebDataViewModel();

            model.WebDataList = Session["WebDataList"] as List <WebDataModel>;
            model.getWebType();
            if (!string.IsNullOrEmpty(model.Message))
            {
                return(View(model));
            }
            WebDataModel SelectData = new WebDataModel();

            SelectData        = model.WebDataList.Where(x => x.WebName == WebName).FirstOrDefault();
            model.WebName     = SelectData.WebName;
            model.WebTypeNeme = SelectData.WebTypeNeme;
            model.WebURL      = SelectData.WebURL;
            return(View(model));
        }
Пример #5
0
        //
        // GET: /LikeWeb/
        public ActionResult LikeWebMainPage()
        {
            WebDataViewModel model = new WebDataViewModel();


            model.getWebdataDB();
            if (!string.IsNullOrEmpty(model.Message))
            {
                return(View(model));
            }
            model.getWebType();
            if (!string.IsNullOrEmpty(model.Message))
            {
                return(View(model));
            }
            Session["WebDataList"] = model.WebDataList;

            return(View(model));
        }
Пример #6
0
        public WebDataViewModel GetWebData()
        {
            var curMonth = DateTime.UtcNow.Month;
            var curWeek  = DateTime.UtcNow.AddDays(-7);

            WebDataViewModel model = new WebDataViewModel();

            model.TotalUser = this.usersService
                              .GetAllUsers()
                              .Count();

            model.NewUsersLastMonth = this.usersService
                                      .GetAllUsers()
                                      .Where(u => u.CreatedOn.Month == curMonth)
                                      .Count();

            model.NewUsersLastWeek = this.usersService
                                     .GetAllUsers()
                                     .Where(u => u.CreatedOn >= curWeek)
                                     .Count();

            model.TotalRoutes = this.routeService
                                .GetAllRoutes()
                                .Count();

            model.NewRoutesLastMonth = this.routeService
                                       .GetAllRoutes()
                                       .Where(u => u.CreatedOn.Month == curMonth)
                                       .Count();

            model.NewRoutesLastWeek = this.routeService
                                      .GetAllRoutes()
                                      .Where(u => u.CreatedOn >= curWeek)
                                      .Count();

            model.TotalStories = this.storyService
                                 .GetAllStories()
                                 .Count();

            model.NewStoriesLastMonth = this.storyService
                                        .GetAllStories()
                                        .Where(u => u.CreatedOn.Month == curMonth)
                                        .Count();

            model.NewStoriesLastWeek = this.storyService
                                       .GetAllStories()
                                       .Where(u => u.CreatedOn >= curWeek)
                                       .Count();

            model.TotalAlbums = this.albumService
                                .GetAllAlbums()
                                .Count();

            model.NewAlbumsLastMonth = this.albumService
                                       .GetAllAlbums()
                                       .Where(u => u.CreatedOn.Month == curMonth)
                                       .Count();

            model.NewAlbumsLastWeek = this.albumService
                                      .GetAllAlbums()
                                      .Where(u => u.CreatedOn >= curWeek)
                                      .Count();

            model.TotalPhotos = this.cloudService
                                .GetAllPhotos()
                                .Count();

            model.NewPhotosLastMonth = this.cloudService
                                       .GetAllPhotos()
                                       .Where(u => u.CreatedOn.Month == curMonth)
                                       .Count();

            model.NewPhotosLastWeek = this.cloudService
                                      .GetAllPhotos()
                                      .Where(u => u.CreatedOn >= curWeek)
                                      .Count();

            return(model);
        }