private void Button_Clicked(object sender, EventArgs e) { if (IdeasService.Build().CreateOrUpdate(UpdateEntityFromEntries(EntityDto)) > 0) { DisplayAlert("Sucesso!", "Ideia cadastrada", "Ok"); Navigation.PushAsync(new IdeasPage()); } }
private void Button_Clicked(object sender, EventArgs e) { if (IdeasService.Build().Update(UpdateEntityFromEntries(EntityDto)) > 0) { DisplayAlert("Sucesso!", "Brainstorming salvo", "Ok"); Navigation.PopAsync(); } }
private async void Delete(object sender, EventArgs e) { int id = Convert.ToInt32(((Image)sender).ClassId); IdeaDTO entityDto = entityDtos.Find(x => x.Id == id); string confirm = await DisplayActionSheet("Tem certeza que deseja excluir este item?", "Voltar", null, "Sim", "Não"); if (confirm == "Sim") { if (IdeasService.Build().Delete(entityDto) > 0) { await DisplayAlert("Sucesso", "Ideia " + entityDto.Description + " deletada", "Ok"); entityDtos.Remove(entityDto); RefreshList(); } } }
private async void GetIdeas() { entityDtos = await IdeasService.Build().GetAll(); }