public MenuViewModel(MenuView menuViewOpen, string JMBG) { menuView = menuViewOpen; pizzeriaService = new PizzeriaService(); PizzaList = pizzeriaService.GetPizzas(); orederedPizzas = new List <tblPizzaOrder>(); ordersOfUser = pizzeriaService.GetOrdersOfGuest(JMBG); if (ordersOfUser.Any()) { if (ordersOfUser.Last().OrderStatus == "W") { ViewMakeOrder = Visibility.Hidden; ViewShowOrder = Visibility.Visible; } } this.JMBG = JMBG; }
public GuestMainViewModel(GuestMainView guestMainViewOpen, string JMBG) { pizzeriaService = new PizzeriaService(); guestMainView = guestMainViewOpen; this.JMBG = JMBG; ordersOfUser = pizzeriaService.GetOrdersOfGuest(JMBG); if (ordersOfUser.Any()) { if (ordersOfUser.Last().OrderStatus == "A") { //ViewAprovedOrder = Visibility.Visible; //ViewMainMenu = Visibility.Hidden; //Thread.Sleep(3000); //ViewAprovedOrder = Visibility.Hidden; //ViewMainMenu = Visibility.Visible; ApprovedWindow approvedWindow = new ApprovedWindow(); approvedWindow.ShowDialog(); MessageBox.Show("Your last order is aproved"); } if (ordersOfUser.Last().OrderStatus == "R") { //ViewAprovedOrder = Visibility.Visible; //ViewMainMenu = Visibility.Hidden; //Thread.Sleep(3000); //ViewAprovedOrder = Visibility.Hidden; //ViewMainMenu = Visibility.Visible; //RefusedWindow refusedWindow = new RefusedWindow(); //refusedWindow.ShowDialog(); //Thread.Sleep(2000); //refusedWindow.Close(); MessageBox.Show("Your last order is refused"); } } }