public UserWindow(string login, SmartParkingApp.ParkingManager pm) { InitializeComponent(); this.pm = pm; user = pm.FindUserByLogin(login); var sessionList = new List <SmartParkingApp.Models.ParkingSession>(); if (pm.UsersParkingSession(user.Id, out sessionList)) { var activeSession = sessionList[sessionList.Count - 1]; TextBuilder(activeSession); } else { if (sessionList.Count != 0) { var lastSession = sessionList[sessionList.Count - 1]; TextBuilder(lastSession); } else { MessageBox.Show("История парковки отсутствует"); } } var contentList = new List <DateTime>(); foreach (var s in sessionList) { contentList.Add(s.EntryDt); } sessions = sessionList; GetAllComboBox.ItemsSource = contentList; }
private void Get_Cost_Click(object sender, RoutedEventArgs e) { var sessionList = new List <SmartParkingApp.Models.ParkingSession>(); if (pm.UsersParkingSession(user.Id, out sessionList)) { MessageBox.Show("Remaining Cost: " + (pm.GetRemainingCost(sessionList[sessionList.Count - 1].TicketNumber).ToString())); } else { MessageBox.Show("Remaining Cost = 0"); } }