Esempio n. 1
0
        public ActionResult Index(int? index)
        {
            BlockIndexModel model = new BlockIndexModel();

            model.Modules = this.repository.FindAll();

            if (index.HasValue)
                model.Index = index.Value;

            return View(model);
        }
Esempio n. 2
0
        public ActionResult Index(int? id)
        {
            if (TempData["HintMessage"] != null)
            {
                ViewData["HintMessage"] = TempData["HintMessage"];
            }

            BlockIndexModel model = new BlockIndexModel(this.repository.FindAll().OrderBy(m => m.Status).OrderBy(m => m.Key).ToList());

            Module selectedModel = null;
            if (id.HasValue)
            {
                model.Index = id.Value;
                selectedModel = repository.FindBy(id.Value);
            }
            ViewData["selectedModel"] = selectedModel;

            return View(model);
        }