コード例 #1
0
        public ActionResult DdlSubmit()
        {
            var items = new List<SelectListItem>
            {
                new SelectListItem {Text = "Drugi", Value = "0"},
                new SelectListItem {Text = "Seznam", Value = "1"},
                new SelectListItem {Text = "Kategorij", Value = "2", Selected = true}
            };
            ViewBag.MovieType = items;

            var cs = new TestniKomitent();
            return View("Index", cs.FillTestData());
        }
コード例 #2
0
        public ActionResult Index()
        {
            var items = new List<SelectListItem>
            {
                new SelectListItem {Text = "Action", Value = "0"},
                new SelectListItem {Text = "Drama", Value = "1"},
                new SelectListItem {Text = "Comedy", Value = "2", Selected = true},
                new SelectListItem {Text = "Science Fiction", Value = "3"}
            };
            ViewBag.MovieType = items;

            var cs = new TestniKomitent();
            return View(cs.FillTestData());
        }
コード例 #3
0
        public ActionResult Isci(string searchString)
        {
            var cs = new TestniKomitent();
            var komitenti = cs.FillTestData();

            if (!string.IsNullOrEmpty(searchString))
            {
                komitenti = komitenti.Where(w => w.LastName.Contains(searchString)).ToList();
            }

            if (komitenti.Count == 1)
            {
                return PartialView("_EnKomitent", komitenti.First());
            }
            else
            {
                return PartialView("_VsiKomitenti", komitenti);
            }
        }
コード例 #4
0
        public ActionResult Isci(string searchString)
        {
            var cs = new TestniKomitent();
            var komitenti = cs.FillTestData();

            if (!string.IsNullOrEmpty(searchString))
            {
                komitenti = komitenti.Where(w => w.LastName.Contains(searchString)).ToList();
            }

            // Če je samo en rezultat prikaži view EnKomitent, če več VsiKomitenti.
            if (komitenti.Count == 1)
            {
                return View("EnKomitent", komitenti.First());
            }
            else
            {
                return View("VsiKomitenti", komitenti);
            }
        }
コード例 #5
0
 public ActionResult VsiKomitenti()
 {
     var cs = new TestniKomitent();
     return PartialView("_VsiKomitenti", cs.FillTestData());
 }
コード例 #6
0
 public ActionResult VsiKomitenti()
 {
     var cs = new TestniKomitent();
     return View(cs.FillTestData());
 }