Esempio n. 1
0
        public ViewResult Index()
        {
            var tree  = new TreeSource().GetTree(Guid.Empty, Url);
            var model = new Index(tree.RootItems, GetRoomTypes());

            return(View(model));
        }
        public ViewResult Details(Guid Id)
        {
            var tree  = new TreeSource().GetTree(Id, Url);
            var model = new Details(tree, Id, tree.RootItems.Single(item => item.Id == Id).Text);

            return(View(model));
        }
Esempio n. 3
0
        public ViewResult Details(Guid Id)
        {
            var tree = new TreeSource().GetTree(Id, Url);

            var roomId     = Id;
            var mapId      = FacilitiesSingleton.Facilities.GetParent(roomId);
            var buildingId = FacilitiesSingleton.Facilities.GetParent(mapId);
            var campusId   = FacilitiesSingleton.Facilities.GetParent(buildingId);

            var campus     = tree.RootItems.Single(item => item.Id == campusId);
            var campusName = campus.Text;

            var building     = campus.Children.Single(item => item.Id == buildingId);
            var buildingName = building.Text;

            var map     = building.Children.Single(item => item.Id == mapId);
            var mapName = map.Text;

            var room     = map.Children.Single(item => item.Id == roomId);
            var roomName = room.Text;

            var mapImageUrl = Url.Action("Image", "Map", new { Id = mapId });

            var roomPolygon = new Polygon(new[]
            {
                new[] { 257, 94 },
                new[] { 257, 213 },
                new[] { 327, 213 },
                new[] { 327, 94 }
            });

            var model = new Details(tree, roomId, roomName, mapId, mapName, buildingId, buildingName, campusId,
                                    campusName, mapImageUrl, roomPolygon,
                                    null,
                                    GetRoomTypes(),
                                    25,
                                    new[]
            {
                "PC",
                "Whiteboard",
                "Lab Sink",
                "Projector"
            },
                                    new Dictionary <string, int>
            {
                { "PC", 25 },
                { "Whiteboard", 2 },
                { "Projector", 1 }
            });

            return(View(model));
        }
        public ViewResult Details(Guid Id)
        {
            var tree = new TreeSource().GetTree(Id, Url);

            var buildingId = Id;
            var campusId   = FacilitiesSingleton.Facilities.GetParent(Id);
            var campus     = tree.RootItems.Single(item => item.Id == campusId);
            var campusName = campus.Text;

            var building     = campus.Children.Single(item => item.Id == buildingId);
            var buildingName = building.Text;

            var model = new Details(tree, buildingId, buildingName, campusId, campusName);

            return(View(model));
        }
Esempio n. 5
0
        public ViewResult Details(Guid Id)
        {
            var tree = new TreeSource().GetTree(Id, Url);

            var mapId      = Id;
            var buildingId = FacilitiesSingleton.Facilities.GetParent(mapId);
            var campusId   = FacilitiesSingleton.Facilities.GetParent(buildingId);

            var campus     = tree.RootItems.Single(item => item.Id == campusId);
            var campusName = campus.Text;

            var building     = campus.Children.Single(item => item.Id == buildingId);
            var buildingName = building.Text;

            var map     = building.Children.Single(item => item.Id == mapId);
            var mapName = map.Text;

            var mapImageUrl = Url.Action("Image", new { Id = mapId });

            var model = new Details(tree, mapId, mapName, buildingId, buildingName, campusId, campusName, mapImageUrl);

            return(View(model));
        }
        public JsonResult Data()
        {
            var tree = new TreeSource().GetTree(Guid.Empty, Url);

            return(Json(tree.RootItems, JsonRequestBehavior.AllowGet));
        }
        public ViewResult Index()
        {
            var tree = new TreeSource().GetTree(Guid.Empty, Url);

            return(View(new Index(tree.RootItems)));
        }