示例#1
0
 public async Task AddOrUpdateSharitItemAsync(SharitItem sharitItem)
 {
     if (string.IsNullOrEmpty(sharitItem.Id))
     {
         await _sharitItemTable.InsertAsync(sharitItem);
     }
     else
     {
         await _sharitItemTable.UpdateAsync(sharitItem);
     }
 }
示例#2
0
        public override async void OnAppearing(object navigationContext)
        {
            NavigationService.Instance.PushSharitModal();
            _selectedItem = null;
            base.OnAppearing(navigationContext);

            if (Items == null)
            {
                await LoadSharitItemsAsync();
            }

            NavigationService.Instance.PopSharitModal();
        }
示例#3
0
        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();
            }
        }
示例#4
0
 public async Task DeleteSharitItemAsync(SharitItem sharitItem)
 {
     await _sharitItemTable.DeleteAsync(sharitItem);
 }