示例#1
0
        public ViewResult Create()
        {
            ViewBag.Types     = new SelectList(_typeService.GetAllTypes(), "Id", "Name");
            ViewBag.Genres    = new MultiSelectList(_genreService.GetAllGenres(), "Id", "Name");
            ViewBag.Languages = new SelectList(_languageService.GetAllLanguages(), "Id", "Description");
            var authors = _authorService.GetAllAuthors().Select(author => new AuthorViewModel
            {
                Id       = author.Id,
                FullName = author.Id + "-" + author.FirstName + " " + author.LastName
            });

            ViewBag.Authors = new SelectList(authors, "Id", "FullName");

            return(View());
        }
        // GET: Type
        public ActionResult Index()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new TypeService(userId);
            var model   = service.GetAllTypes();

            return(View(model));
        }
示例#3
0
        // GET: Type
        public ActionResult Index()
        {
            var types = _typeService.GetAllTypes();

            return(View(types));
        }