Ejemplo n.º 1
0
        public static void FillPanelsSelectList(
            this BaseController _controller,
            DisplayMonkeyEntities _db,
            int canvasId,
            object _selected = null
            )
        {
            var query = _db.Panels
                        .Where(p => p.CanvasId == canvasId)
                        .Select(p => new
            {
                PanelId = p.PanelId,
                Name    = p.Name
            })
                        .OrderBy(p => p.Name)
                        .ToList()
            ;

            _controller.ViewBag.Panels =
                new SelectList(query, "PanelId", "Name", _selected);
        }
Ejemplo n.º 2
0
        public static void FillTemplatesSelectList(
            this BaseController _controller,
            DisplayMonkeyEntities _db,
            FrameTypes _frameType,
            object _selected = null
            )
        {
            var query = _db.Templates
                        .Where(t => t.FrameType == _frameType)
                        .Select(t => new
            {
                TemplateId = t.TemplateId,
                Name       = t.Name
            })
                        .OrderBy(t => t.Name)
                        .ToList()
            ;

            _controller.ViewBag.Templates =
                new SelectList(query, "TemplateId", "Name", _selected);
        }