public async Task AddOrUpdateSharitItemAsync(SharitItem sharitItem) { if (string.IsNullOrEmpty(sharitItem.Id)) { await _sharitItemTable.InsertAsync(sharitItem); } else { await _sharitItemTable.UpdateAsync(sharitItem); } }
public override async void OnAppearing(object navigationContext) { NavigationService.Instance.PushSharitModal(); _selectedItem = null; base.OnAppearing(navigationContext); if (Items == null) { await LoadSharitItemsAsync(); } NavigationService.Instance.PopSharitModal(); }
private async Task SaveAsync() { if (RequiredElements.Any(e => string.IsNullOrEmpty(e.Text))) { MarkRequiredElements(); } else { NavigationService.Instance.PushSharitModal(); var sharitItem = new SharitItem { //Id = Id, Title = Title, Description = Description, Date = Date, Price = Price }; await ClientHttpService.Instance.AddSharitItem(sharitItem); NavigationService.Instance.PopSharitModal(); NavigationService.Instance.NavigateBack(); } }
public async Task DeleteSharitItemAsync(SharitItem sharitItem) { await _sharitItemTable.DeleteAsync(sharitItem); }