Ejemplo n.º 1
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            WebServiceBase <List <Aluno> > .RequestAsync("alunos").ContinueWith(t => {
                Device.BeginInvokeOnMainThread(() => {
                    lstAlunos.ItemsSource = t.Result;
                });
            });
        }
        void btnInserir(object sender, EventArgs e)
        {
            var aluno = new Aluno()
            {
                nome  = eNome.Text,
                email = eEmail.Text
            };

            WebServiceBase <Aluno> .RequestAsync("alunos", RequestType.Post, aluno);
        }
Ejemplo n.º 3
0
        void lvAluno_Sl(object sender, SelectedItemChangedEventArgs e)
        {
            var aluno = e.SelectedItem as Aluno;

            WebServiceBase <Aluno> .RequestAsync("alunos/" + aluno._id, RequestType.Delete);


            WebServiceBase <List <Aluno> > .RequestAsync("alunos").ContinueWith(t => {
                Device.BeginInvokeOnMainThread(() => {
                    lstAlunos.ItemsSource = t.Result;
                });
            });
        }