コード例 #1
0
        public ActionResult Chat(int roomId)
        {
            User user = (User)HttpContext.Session["user"];

            if (user == null)
            {
                return(RedirectToAction("Login", "Home"));
            }
            ViewBag.roomId = roomId;
            Event currentEvent = EventCache.GetEventBag().FirstOrDefault(x => x.Id == roomId);

            ViewModels.ChatModel chatModel = new ViewModels.ChatModel();
            chatModel.User         = user;
            chatModel.CurrentEvent = currentEvent;
            return(View(chatModel));
        }
コード例 #2
0
        public ActionResult Quadrants(string quadrant)
        {
            ViewModels.QuadrantModel quadrantModel = new ViewModels.QuadrantModel();

            quadrantModel.Events            = EventCache.GetEventBag().Where(x => x.Quadrant == quadrant).ToList();
            quadrantModel.PointsOfInterests = PointsOfInterestCache.GetPointsOfInterestBag()
                                              .Where(x => x.Location == quadrant).ToList();

            switch (quadrant)
            {
            case "NW":
                quadrantModel.Lat        = "51.0750527";
                quadrantModel.Lng        = "-114.1194289";
                quadrantModel.Quadrant   = "NW";
                quadrantModel.Population = 330000L;
                ;
                break;

            case "NE":

                quadrantModel.Lat        = "51.0865101";
                quadrantModel.Lng        = "-113.967823";
                quadrantModel.Quadrant   = "NE";
                quadrantModel.Population = 265000L;
                break;

            case "SW":
                quadrantModel.Lat        = "51.0213185";
                quadrantModel.Lng        = "-114.1023589";
                quadrantModel.Quadrant   = "SW";
                quadrantModel.Population = 280000L;

                break;

            case "SE":
                quadrantModel.Lat        = "51.011528";
                quadrantModel.Lng        = "-113.9891212";
                quadrantModel.Quadrant   = "SE";
                quadrantModel.Population = 355000L;
                break;

            default:
                break;
            }
            return(View(quadrantModel));
        }
コード例 #3
0
 // GET: api/Event/5
 public Event Get(int id)
 {
     return(EventCache.GetEventBag().Find(x => x.Id == id));
 }
コード例 #4
0
//        DataModel db = new DataModel();

        // GET: api/Event
        public IEnumerable <Event> Get()
        {
            return(EventCache.GetEventBag());
        }
コード例 #5
0
 public ActionResult Index()
 {
     ViewModels.EventViewModel eventViewModel = new ViewModels.EventViewModel();
     eventViewModel.Events = EventCache.GetEventBag();
     return(View(eventViewModel));
 }