Пример #1
0
 // GET: Books/Create
 public IActionResult Create()
 {
     ViewData["AuthorId"]       = new SelectList(_iAuthorManager.GetAll(), "Id", "Name");
     ViewData["BookCategoryId"] = new SelectList(_iBookCategoryManager.GetAll(), "Id", "Name");
     ViewData["LanguageId"]     = new SelectList(_iLanguageManager.GetAll(), "Id", "Name");
     ViewData["PublisherId"]    = new SelectList(_iPublisherManager.GetAll(), "Id", "Name");
     return(View());
 }
Пример #2
0
        public void SetSessionPublishers()
        {
            var publishers_list = publisherManager.GetAll();

            List <SelectListItem> listItems = new List <SelectListItem>();

            foreach (var item in publishers_list)
            {
                listItems.Add(new SelectListItem
                {
                    Text  = item.Name,
                    Value = item.PublisherId.ToString()
                });
            }
            Session["Publishers"] = listItems;
        }
Пример #3
0
        // GET: Publishers
        public IActionResult Index()
        {
            var publisher = _iPublisherManager.GetAll();

            return(View(publisher));
        }