Пример #1
0
        public ActionResult <PokDatLst> Get(string text, string opt)
        {
            var lst = string.IsNullOrEmpty(text) ? pdb.SelectFirstNine()
                : !string.IsNullOrEmpty(opt) ? pdb.SelectByOpt(text, opt)
                : pdb.SelectFirstNine();
            var slst = new List <SelectListItem>();
            var sopt = new SelectListItem {
                Value = "Id", Text = "Id"
            };

            slst.Add(sopt);
            sopt = new SelectListItem {
                Value = "Name", Text = "Name"
            };
            slst.Add(sopt);

            var pklst = new PokDatLst
            {
                Count     = lst.Count,
                Lst       = lst,
                SelOpts   = slst,
                PokSelect = opt,
                Text      = text
            };

            return(Ok(pklst));
        }
Пример #2
0
        public ActionResult <PokDatLst> Get(string text)
        {
            var lst   = !string.IsNullOrEmpty(text) ? pdb.SelectByName(text) : pdb.SelectFirstNine();
            var pklst = new PokDatLst
            {
                Count = 9,
                Lst   = lst,
            };

            return(Ok(pklst));
        }
Пример #3
0
        public ActionResult <PokDatLst> Get()
        {
            var lst = new List <PokDat>();
            int i   = 1;

            while (i < 10)
            {
                var pok = pdb.PokDat.SelectById(i);
                lst.Add(pok);
                i++;
            }
            var pklst = new PokDatLst
            {
                Count = 9,
                Lst   = lst
            };

            return(Ok(pklst));
        }