public ActionResult GetAuthors()
        {
            List <LibraryCommon.Author> _list = authorBL.GetAuthorPassThru();

            AuthorListVM model = new AuthorListVM(_list);

            return(View(model));
        }
Exemplo n.º 2
0
        public void Get_Author_Thru_Business_Logic()
        {
            //AuthorBusinessLogic _businessLogic = new AuthorBusinessLogic();


            List <Author> _callOne = _businessLogic.GetAuthorPassThru();
            List <Author> _callTwo = _businessLogic.GetAuthorPassThru();


            Assert.AreEqual(_callOne.Count, _callTwo.Count);
        }
        public ActionResult CreateBook()
        {
            PublisherListVM pubList = new PublisherListVM(pubBL.BLGetPublishers());

            ViewBag.Publishers = new SelectList(pubList.ListOfPublisherModels, "PublisherId", "Name");
            AuthorModelVM authList = new AuthorModelVM(authBL.GetAuthorPassThru());

            ViewBag.Authors = new SelectList(authList.ListOfAuthorModel, "AuthorId", "LastName");
            GenreListVM genList = new GenreListVM(genBL.BLGetGenres());

            ViewBag.Genres = new SelectList(genList.ListOfGenreModels, "GenreId", "Name");

            return(View());
        }
        public ActionResult GetAuthors()
        {
            List <Author> list = authBusLay.GetAuthorPassThru();

            AuthorModelVM _curr = new AuthorModelVM(list);



            //List<Author> authlist = list;



            //GetAuthors model = new AuthorListVM(authlist);


            // into business logic layer
            // to dataaccess layer

            return(View(_curr));
        }
        public void ViewBagsForCreateAndUpdate()
        {
            PublisherBusinessLogic _publisherBL = new PublisherBusinessLogic();
            AuthorBusinessLogic    _authorBL    = new AuthorBusinessLogic();
            GenreBusinessLogic     _genreBL     = new GenreBusinessLogic();
            //calling BusniessLogicLayer to establich connection

            //assigns ViewBag use a List made in the bookvm instead of viewsbags

            AuthorListVM list = new AuthorListVM(_authorBL.GetAuthorPassThru());

            ViewBag.Authors = new SelectList(list.ListOfAuthorModels, "AuthorID", "LastName");

            PublisherListVM _publisherList = new PublisherListVM(_publisherBL.GetPublisherPassThru());

            ViewBag.Publishers = new SelectList(_publisherList.ListOfPublisherModels, "PublisherID", "Name");

            GenreListVM _genreList = new GenreListVM(_genreBL.GetGenrePassThru());

            ViewBag.Genres = new SelectList(_genreList.ListOfGenreModels, "GenreID", "Name");
        }