示例#1
0
        private async void btnPrikazi_Click(object sender, EventArgs e)
        {
            var search = new SkladistaSearchRequest()
            {
                Naziv = txtSkladistaPretraga.Text
            };
            var result = await _apiService.Get <List <Model.Skladista> >(search);

            dgvSkladista.AutoGenerateColumns = false;
            dgvSkladista.DataSource          = result;
        }
示例#2
0
        private async void BtnPretraga_Click(object sender, EventArgs e)
        {
            var search = new SkladistaSearchRequest()
            {
                Naziv = txtPretraga.Text,
            };

            var result = await _service.Get <List <Model.Models.Skladista> >(search);

            dgvSkladista.DataSource = result;
        }
        public List <Skladista> Get(SkladistaSearchRequest search)
        {
            {
                var query = _context.Skladista.AsQueryable();

                if (!string.IsNullOrWhiteSpace(search?.Naziv))
                {
                    query = query.Where(x => x.Naziv.StartsWith(search.Naziv));
                }

                if (!string.IsNullOrWhiteSpace(search?.Adresa))
                {
                    query = query.Where(x => x.Adresa.StartsWith(search.Adresa));
                }



                var list = query.ToList();

                return(_mapper.Map <List <Model.Models.Skladista> >(list));
            }
        }
示例#4
0
        public List <Skladista> Get([FromQuery] SkladistaSearchRequest request)
        {
            var list = _service.Get(request);

            return(list);
        }