private async void LoadBalance() { IsLoading = true; var simBalance = await _simBalanceRepository.GetBalance(_mobileNumber.Number); if (simBalance == null) { return; } var simBalanceGroup = new Group { Title = ResourceLoader.GetString("Balance") }; simBalanceGroup.Items.Add(new SimBalanceItem { Title = ResourceLoader.GetString("Credit"), Value = simBalance.Credit.ToString("0.00 €") }); simBalanceGroup.Items.Add(new SimBalanceItem { Title = ResourceLoader.GetString("Data"), Value = simBalance.Data.ToString("0.00 MB") }); simBalanceGroup.Items.Add(new SimBalanceItem { Title = ResourceLoader.GetString("Sms"), Value = simBalance.SmsCount.ToString() }); simBalanceGroup.Items.Add(new SimBalanceItem { Title = ResourceLoader.GetString("ValidUntil"), Value = simBalance.ValidUntil.ToString("dd/MM/yyyy", CultureInfo.CurrentCulture) }); simBalanceGroup.Items.Add(new SimBalanceItem { Title = ResourceLoader.GetString("MVCredit"), Value = (simBalance.MobileVikingsCredit / 60).ToString("0.00 Min.") }); simBalanceGroup.Items.Add(new SimBalanceItem { Title = ResourceLoader.GetString("MVSms"), Value = simBalance.MobileVikingsSmsCount.ToString() }); Groups.Add(simBalanceGroup); LoadTopUpHistory(); }
private async void LoadTopUpHistory() { var history = await _topUpHistory.GetHistory(_mobileNumber.Number); var topUpHistoryGroup = new Group { Title = ResourceLoader.GetString("TopUpHistory") }; if (history == null) { return; } foreach (var topUpHistory in history) { topUpHistoryGroup.Items.Add(new TopUpHistoryItem { Method = topUpHistory.Method, Title = topUpHistory.Amount.ToString("0.00 €"), Received = topUpHistory.Received.ToString("dd/MM/yyyy HH:mm"), Status = topUpHistory.Status }); } Groups.Add(topUpHistoryGroup); LoadUsageHistory(); }
private async void LoadUsageHistory() { var history = await _usageHistory.GetUsage(_mobileNumber.Number); var usageHistoryGroup = new Group { Title = ResourceLoader.GetString("Usagehistory") }; if (history == null) { return; } foreach (var usage in history) { usageHistoryGroup.Items.Add( new UsageItem { Duration = usage.Duration, IsData = usage.IsData, IsMms = usage.IsMms, IsSms = usage.IsSms, IsVoice = usage.IsVoice, Title = usage.To, Start = usage.Start.ToString("HH:mm dd/MM/yyyy") }); } Groups.Add(usageHistoryGroup); IsLoading = false; }