private protected override async Task GetDataAsync(int id) { PaymentCard card = await PaymentCardProcessor.GetCard(ApiHelper.ApiClient, id); if (card != null) { var decryptedCard = (PaymentCard)DecryptItem(card); PaymentCard = decryptedCard; _tempPaymentCard = (PaymentCard)decryptedCard.Clone();//store a temp card for future verifications } else await PageService.PushPopupAsync(new ErrorView(ErrorMsg.CouldNotGetItem(ItemType))); }
private protected override async Task <IEnumerable <Grouping <string, ItemPreview> > > RefreshPageAsync() { IEnumerable <Grouping <string, ItemPreview> > newList = await PaymentCardProcessor.GetPreviews(ApiHelper.ApiClient); return(newList); }
private protected override async Task GetDataAsync() { IEnumerable <Grouping <string, ItemPreview> > previews = await PaymentCardProcessor.GetPreviews(ApiHelper.ApiClient); DisplayItems(previews); }
private protected override async Task<DeleteCallStatus> DeleteAsync() { bool isSuccess = await PaymentCardProcessor.Delete(ApiHelper.ApiClient, PaymentCard.Id); return new DeleteCallStatus(isSuccess, PaymentCard.Id); }
private protected override async Task<ModifyCallStatus> ModifyAsync(int id) { var encryptedCard = (PaymentCard)EncryptItem(PaymentCard); bool isSuccess = await PaymentCardProcessor.Modify(ApiHelper.ApiClient, id, encryptedCard); return new ModifyCallStatus(isSuccess, _tempPaymentCard.Name != PaymentCard.Name, new ItemPreview(PaymentCard.Id, PaymentCard.Name, TypeOfItems.PaymentCard.ToSampleString(), TypeOfItems.PaymentCard)); }
private protected override async Task<bool> CreateAsync() { var encryptedCard = (PaymentCard)EncryptItem(PaymentCard); bool isSuccess = await PaymentCardProcessor.CreateCard(ApiHelper.ApiClient, encryptedCard); return isSuccess; }