Example #1
0
        private ApiWeb CriarApi()
        {
            int    idUs  = Convert.ToInt32(edtUsuario.Text);
            string senha = edtChave.Text;
            string url   = edtUrl.Text;

            ApiWeb api = new ApiWeb(idUs, senha, url);

            return(api);
        }
Example #2
0
        private void btnModalidade_Click(object sender, EventArgs e)
        {
            ApiWeb api = CriarApi();

            var lista = api.ConsultarModalidade();

            if (!api.httpResult.Erro)
            {
                dgvDados.DataSource = lista;
            }
            else
            {
                MessageBox.Show(api.httpResult.MensagemErro);
            }
        }
Example #3
0
        private void btnItens_Click(object sender, EventArgs e)
        {
            int numero = Convert.ToInt32(edtNumero.Text);
            int ano    = Convert.ToInt32(edtAno.Text);

            ApiWeb api = CriarApi();

            var lista = api.ConsultarItens(numero, ano);

            if (!api.httpResult.Erro)
            {
                dgvDados.DataSource = lista;
            }
            else
            {
                MessageBox.Show(api.httpResult.MensagemErro);
            }
        }