コード例 #1
0
        public ActionResult Add()
        {
            List <SelectListItem> valueCategory = (from x in categoryManager.GetAll()
                                                   select new SelectListItem
            {
                Text = x.CategoryName,
                Value = x.CategoryId.ToString()
            }).ToList();

            ViewBag.categoryVlc = valueCategory;

            List <SelectListItem> valueWriter = (from x in writerManager.GetAll()
                                                 select new SelectListItem
            {
                Text = x.WriterName + " " + x.WriterSurName,
                Value = x.WriterId.ToString()
            }).ToList();

            ViewBag.writerVlc = valueWriter;

            return(View());
        }
コード例 #2
0
        public ActionResult AddHeading()
        {
            List <SelectListItem> valueCategory = (from category in categoryManager.GetAll()
                                                   select new SelectListItem
            {
                Text = category.CategoryName,
                Value = category.CategoryId.ToString()
            }).ToList();

            List <SelectListItem> valueWriter = (from writer in writerManager.GetAll()
                                                 select new SelectListItem
            {
                Text = writer.WriterName + " " + writer.WriterSurName,
                Value = writer.WriterId.ToString()
            }).ToList();

            ViewBag.category = valueCategory;
            ViewBag.writer   = valueWriter;
            return(View());
        }
コード例 #3
0
        public ActionResult Add()
        {
            List <SelectListItem> CategoryList = (from c in categoryManager.GetAll()
                                                  select new SelectListItem
            {
                Text = c.Name,
                Value = c.Id.ToString()
            }).ToList();

            List <SelectListItem> WriterList = (from w in writerManager.GetAll()
                                                select new SelectListItem
            {
                Text = w.FirstName + " " + w.LastName,
                Value = w.Id.ToString()
            }).ToList();

            ViewBag.CategoryList = CategoryList;
            ViewBag.WriterList   = WriterList;

            return(View());
        }
コード例 #4
0
 public ActionResult Index()
 {
     return(View(writerManager.GetAll()));
 }
コード例 #5
0
        public ActionResult List()
        {
            var model = writerManager.GetAll();

            return(View(model));
        }
コード例 #6
0
        public ActionResult Index()
        {
            var WriterValues = _writerManager.GetAll();

            return(View(WriterValues));
        }
コード例 #7
0
        public ActionResult Index(int?page)
        {
            var writerValues = _writerManager.GetAll().ToPagedList(page ?? 1, 6);;

            return(View(writerValues));
        }