예제 #1
0
 public ActionResult MyAnnouncementsMobile(PagerSortModel sortModel = null)
 {
     //var myAnnouncements = _announcementRepository.ReadByUser(_announcementRepository.Read(), WebSecurity.CurrentUserId);
     ViewBag.UpTimeAnnouncement = int.Parse(_configRepository.ReadByName("UpTimeAnnouncement").Value);
     ViewBag.SortModel          = sortModel;
     ViewBag.Title   = "Мои объявления";
     ViewBag.IsAdmin = false;
     try
     {
         var user = _profileRepository.Read(WebSecurity.CurrentUserId);
         if (user != null)
         {
             ViewBag.UserName    = user.Name;
             ViewBag.UserSurName = user.Surname;
             ViewBag.Site        = user.Site;
             ViewBag.Skype       = user.Skype;
             ViewBag.Icq         = user.Icq;
         }
     } catch { }
     if (Roles.IsUserInRole(WebSecurity.CurrentUserName, "Administrator"))
     {
         ViewBag.IsAdmin = true;
         var model = _realtyRepository.Read().OrderByDescending(x => x.CreatedAt);
         return(View("MyAnnouncementsMobile", model.ToPagedList(sortModel.CurrentPage.Value, sortModel.PageSize)));
     }
     else
     {
         var model = _realtyRepository.Read().Where(x => x.UserId == WebSecurity.CurrentUserId).OrderByDescending(x => x.CreatedAt);
         return(View("MyAnnouncementsMobile", model.ToPagedList(sortModel.CurrentPage.Value, sortModel.PageSize)));
     }
 }
예제 #2
0
        public ActionResult Products(PagerSortModel sortModel = null)
        {
            var products = _productBookmarkRepository.ReadProductsByUser(WebSecurity.CurrentUserId).Where(p => p.IsActive == true);

            ViewBag.SortModel = sortModel;
            ViewBag.Title     = "Мои закладки";

            return(View(products.ToPagedList(sortModel.CurrentPage.Value, sortModel.PageSize)));
        }
예제 #3
0
        //
        // GET: /Bookmarks/Realty

        public ActionResult Realty(PagerSortModel sortModel = null)
        {
            var realty = _realtyBookmarksRepository.ReadRealtyByUser(WebSecurity.CurrentUserId).Where(r => r.IsActive == true);

            ViewBag.SortModel = sortModel;
            ViewBag.Title     = "Мои закладки";

            return(View(realty.ToPagedList(sortModel.CurrentPage.Value, sortModel.PageSize)));
        }
예제 #4
0
        //
        // GET: /Bookmarks/Announcements

        public ActionResult Announcements(PagerSortModel sortModel = null)
        {
            var announcements = _bookmarkRepository.ReadAnnouncementsByUser(WebSecurity.CurrentUserId).Where(a => a.IsActive == true);

            ViewBag.SortModel = sortModel;
            ViewBag.Title     = "Мои закладки";

            return(View(announcements.ToPagedList(sortModel.CurrentPage.Value, sortModel.PageSize)));
        }
예제 #5
0
        //
        // GET: /Bookmarks/MyRealty
        public ActionResult MyRealty(PagerSortModel sortModel = null)
        {
            var myRealty = _realtyRepository.ReadByUser(_realtyRepository.Read(),
                                                        WebSecurity.CurrentUserId);

            ViewBag.UpTimeRealty = int.Parse(_configRepository.ReadByName("UpTimeRealty").Value);
            ViewBag.SortModel    = sortModel;
            ViewBag.Title        = "Мои объявления неджвижимости";
            return(View(myRealty.ToPagedList(sortModel.CurrentPage.Value, sortModel.PageSize)));
        }
예제 #6
0
        //
        // GET: /Bookmarks/MyAnnouncements
        public ActionResult MyAnnouncements(PagerSortModel sortModel = null)
        {
            var myAnnouncements = _announcementRepository.ReadByUser(_announcementRepository.Read(),
                                                                     WebSecurity.CurrentUserId);

            ViewBag.UpTimeAnnouncement = int.Parse(_configRepository.ReadByName("UpTimeAnnouncement").Value);
            ViewBag.SortModel          = sortModel;
            ViewBag.Title = "Мои объявления";
            return(View(myAnnouncements.ToPagedList(sortModel.CurrentPage.Value, sortModel.PageSize)));
        }