Пример #1
0
 private void initialiseViewBag(int id = 0)
 {
     if (id == 0)
     {
         ViewBag.Authors        = new MultiSelectList(AuthorModel.GetAuthors(), "AUTHORID", "ALIASNAME");
         ViewBag.PRODUCERID     = new SelectList(ProducerModel.GetProducers(), "PRODUCERID", "NAME");
         ViewBag.Categories     = new MultiSelectList(CategoryModel.GetAllCategory(), "CATEGORYID", "NAME");
         ViewBag.GENREID        = new SelectList(GenreModel.GetGenre(), "GENREID", "NAME");
         ViewBag.LANGUAGEID     = new SelectList(LanguageModel.GetLanguages(), "LANGUAGEID", "LANGUAGE1");
         ViewBag.TRANSLATEDFROM = new SelectList(BookModel.getApprovedBooks(), "BOOKID", "NAME");
     }
     else
     {
         BOOK book = BookModel.FilterBook(id);
         ViewBag.Authors        = new MultiSelectList(AuthorModel.GetAuthors(), "AUTHORID", "ALIASNAME");
         ViewBag.PRODUCERID     = new SelectList(ProducerModel.GetProducers(), "PRODUCERID", "NAME", book.PRODUCER);
         ViewBag.Categories     = new MultiSelectList(CategoryModel.GetAllCategory(), "CATEGORYID", "NAME");
         ViewBag.GENREID        = new SelectList(GenreModel.GetGenre(), "GENREID", "NAME", book.GENREID);
         ViewBag.LANGUAGEID     = new SelectList(LanguageModel.GetLanguages(), "LANGUAGEID", "LANGUAGE1", book.LANGUAGEID);
         ViewBag.TRANSLATEDFROM = new SelectList(BookModel.getApprovedBooks(), "BOOKID", "NAME", book.TRANSLATEDFROM);
     }
 }
Пример #2
0
 public ActionResult Index()
 {
     return(View(CategoryModel.GetAllCategory()));
 }