コード例 #1
0
ファイル: ReBusPivotMenu.xaml.cs プロジェクト: rmusina/rebus
        void ticketService_GetHistoryCompleted(object sender, TicketServiceReference.GetHistoryCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                for (int i = 0; i < e.Result.Count; i++)
                {
                    TicketWebServiceModel currentTicket = e.Result[i];
                    HistoryItem newItem = new HistoryItem("Ticket", currentTicket.Bus.Line.Name, currentTicket.Created.ToString(), "/Images/Bank account.png");
                    historyList.Add(newItem);
                }
                ticketHistoryRecieved = true;

                if (subscriptionHistoryRecieved)
                    SortHistoryByDate();
            }
        }
コード例 #2
0
ファイル: ReBusPivotMenu.xaml.cs プロジェクト: rmusina/rebus
        void subscriptionService_GetHistoryCompleted(object sender, SubscriptionServiceReference.GetHistoryCompletedEventArgs e)
        {
            if (e.Result != null)
            {
                for (int i = 0; i < e.Result.Count; i++)
                {
                    SubscriptionWebServiceModel currentSubscription = e.Result[i];
                    string subscribedLines = "";
                    for (int j = 0; j < currentSubscription.Lines.Count; j++)
                    {
                        SubscriptionServiceReference.LineWebServiceModel currentLine = currentSubscription.Lines[i];
                        subscribedLines += currentLine.Name;
                        if (j < currentSubscription.Lines.Count - 1)
                            subscribedLines += ", ";
                    }
                    HistoryItem newItem = new HistoryItem("Subscription", subscribedLines, currentSubscription.Start.ToString(), "/Images/Account card.png");
                    newItem.ExpDate = currentSubscription.End.ToString();
                    historyList.Add(newItem);
                }
                subscriptionHistoryRecieved = true;

                if (ticketHistoryRecieved)
                    SortHistoryByDate();
            }
        }