Exemplo n.º 1
0
        private async Task LoadPlanove()
        {
            List <Model.PlanIProgram> result = new List <Model.PlanIProgram>();

            if (txtSearchNaziv.Text != null)
            {
                PlanIProgramSearchRequest request = new PlanIProgramSearchRequest
                {
                    Naziv = txtSearchNaziv.Text
                };
                result = await _service.Get <List <Model.PlanIProgram> >(request);
            }
            else
            {
                result = await _service.Get <List <Model.PlanIProgram> >(null);
            }

            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource          = result;
        }
Exemplo n.º 2
0
        private async Task <bool> NazivExists()
        {
            PlanIProgramSearchRequest request = new PlanIProgramSearchRequest
            {
                Naziv = txtNaziv.Text
            };
            List <Model.PlanIProgram> planovi = await _service.Get <List <Model.PlanIProgram> >(request);

            if (planovi.Count > 0 && _PlanId == null)
            {
                return(true);
            }
            if (planovi.Count > 0 && _PlanId != null)
            {
                if (planovi[0].Id != _PlanId)
                {
                    return(true);
                }
            }
            return(false);
        }