Exemple #1
0
        public ActionResult Pubs()
        {
            var returnedPerson = PersonDAO.Search(UserSession.ReturnPersonId(null));
            if (returnedPerson == null) return RedirectToAction("Logout", "User");

            ViewBags(returnedPerson);
            return View(PubDAO.ReturnList().OrderByDescending(l => l.Rating).ToList());
        }
Exemple #2
0
        public void ViewBags()
        {
            var pub = PubDAO.Search(UserSession.ReturnPubId(null));

            var pubsList = PubDAO.ReturnList().Select(x => new { x.Id, x.Name, x.Rating, x.Lat, x.Lng, x.Address, x.FoundationDate }).ToList();

            ViewBag.PubsList = JsonConvert.SerializeObject(pubsList);
            ViewBag.Name     = pub.Name;
            ViewBag.Profile  = pub.PhotoBase64();
        }
Exemple #3
0
        public void ViewBags(Pub returnedPub)
        {
            var pubsList = PubDAO.ReturnList().Select(pub => new GoogleMapPubData()
            {
                Id             = pub.Id,
                Name           = pub.Name,
                Photo          = ImageHandler.PhotoBase64(pub.Photo, pub.PhotoType),
                Rating         = pub.Rating,
                Lat            = pub.Lat,
                Lng            = pub.Lng,
                Address        = pub.Address,
                FoundationDate = pub.FoundationDate
            }).ToList();

            ViewBag.PubsList    = JsonConvert.SerializeObject(pubsList);
            ViewBag.Lng         = returnedPub.Lng == 0 ? -49.276855 : returnedPub.Lng;
            ViewBag.Lat         = returnedPub.Lat == 0 ? -25.441105 : returnedPub.Lat;
            ViewBag.Name        = returnedPub.Name;
            ViewBag.Profile     = ImageHandler.PhotoBase64(returnedPub.Photo, returnedPub.PhotoType);
            ViewBag.LayoutStyle = returnedPub.LayoutStyle;
            ViewBag.Type        = "pub";
        }
Exemple #4
0
 public IQueryable <Pub> GetPubs()
 {
     return(PubDAO.ReturnList().AsQueryable());
 }