Esempio n. 1
0
        public void FacadeLocationInit()
        {
            var            context        = new AOLHackEntities();
            var            carlsberg      = context.Locations.ToList().FirstOrDefault(l => l.Title == "carlsberg");
            ActiveLocation activeLocation = new AOLHack.Site.ActiveLocation();

            activeLocation.Id    = 1;
            activeLocation.Title = carlsberg.Title;
            StateAgent.Locations.Add(activeLocation);
        }
Esempio n. 2
0
        public ActionResult Index(FormCollection form)//FormCollection form)
        {
            var context      = new AOLHackEntities();
            var users        = context.Users.ToList();
            var loggedinUser = users.FirstOrDefault(u => u.Email == form["email"]);

            var selectedlocation = StateAgent.Locations.FirstOrDefault(l => l.Id == int.Parse(form["locationId"]));

            if ((loggedinUser == null) || (selectedlocation == null))
            {
                // sign up in future
                //return ToString login
                return(RedirectToAction("Index", new { locationId = int.Parse(form["locationId"]) }));
            }

            StateAgent.CurrentViewer = new Viewer(loggedinUser);
            selectedlocation.JoinIn();

            return(RedirectToAction("Curator", "View", new { id = int.Parse(form["locationId"]) }));
        }
Esempio n. 3
0
        public ActionResult ListLocations()
        {
            var model = new AOLHackEntities();

            return(View(model.Locations.ToList()));
        }