Beispiel #1
0
        static void Main(string[] args)
        {
            Console.Title = "Coffee Shop Menu";

            ServiceLocator.Setup();
            var orderService = ServiceLocator.GetService <IOrderService>();
            var orderScreen  = new OrderScreen();

            while (true)
            {
                orderService.Initialize();

                do
                {
                    AddOrder();
                }while (!IsOrderComplete());

                orderScreen.DisplayOrder();

                if (ExitProgram())
                {
                    break;
                }
            }
        }
Beispiel #2
0
        private static void SetOrderScreenPosition(OrderScreen screen)
        {
            ListOrderScreen.Add(screen);

            int value = ListOrderScreen.Count % 2;

            screen.Top  = ScreenSlot[value].top;
            screen.Left = ScreenSlot[value].left;
        }
Beispiel #3
0
        private OrderScreen GetOrderScreenFromReader(SqlDataReader reader)
        {
            OrderScreen item = new OrderScreen();

            item.OrderId  = Convert.ToInt32(reader["order_id"]);
            item.Complete = Convert.ToBoolean(reader["completed"]);
            item.UserId   = Convert.ToInt32(reader["app_user_id"]);
            item.UserName = Convert.ToString(reader["app_user_name"]);

            return(item);
        }
    void CreateTicket(OrderScreen screen)
    {
        List <string> obj    = RandomMeal();                         //random meal from the menu
        MealTicket    ticket = new MealTicket(obj[0], TheFood(obj)); //storing information in seperate class

        ticket.SetScreen(screen);
        StartCoroutine(ticket.TickerTimer(screen.TimeText()));                        //starting the timer
        mealTickets.Add(ticket);
        DisplayMeal(ticket.TheFoodInOrder(), ticket.GetMealName(), screen.GetText()); //displaying the meal
        sendAreas[(screen.screenNo) - 1].SetTicket(ticket);                           //assifning the ticket to the correct send area
        screen.SetUse(true);
        audioManager.PlaySound("Bell");
    }
    public void CreateTicket(OrderScreen screen)
    {
        List <string> obj    = RandomMeal();
        MealTicket    ticket = new MealTicket(obj[0], TheFood(obj)); //storing information in seperate class

        ticket.SetScreen(screen);
        //StartCoroutine(ticket.TickerTimer(screen.TimeText()));
        mealTickets.Add(ticket);
        DisplayMeal(ticket.TheFoodInOrder(), ticket.GetMealName(), screen.GetText());
        sendAreas[(screen.screenNo) - 1].SetTicket(ticket);
        screen.SetUse(true);
        audioManager.PlaySound("Bell");
    }
Beispiel #6
0
        public static void CreateNewOrderScreen2(Order newOrder)
        {
            OrderScreen orderScreen = new OrderScreen(newOrder);

            orderScreen.Closed += new EventHandler(orderScreen_Closed);

            SetOrderScreenTime();

            SetOrderScreenPosition(orderScreen);

            orderScreen.Show();
            UpdateMainUI();

            // FileManager.AddNumberToFile(newOrder.Customer.PNumberID);
        }
Beispiel #7
0
        public static void CreateNewAddrDongScreen(OrderScreen target)
        {
            ButtonSelectScreen addrDongScr = new ButtonSelectScreen();

            foreach (var p in DataManager.AddressGetListByGu(target.OrderData.Customer.AddrGugun))
            {
                addrDongScr.panelAddr.Children.Add(btnCreator.btnAddAddrDong(140, 210, 40, p));
            }
            addrDongScr.PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(address_PreviewMouseDown);
            addrDongScr.ShowDialog();
            if (addrDongScr.Data != "취소")
            {
                target.OrderData.Customer.AddrDong = addrDongScr.Data;
            }
        }
Beispiel #8
0
        public static void CreateNewAddrGuScreen(OrderScreen target)
        {
            ButtonSelectScreen addrGuScr = new ButtonSelectScreen();

            addrGuScr.PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(address_PreviewMouseDown);
            foreach (var p in DataManager.AddrGetGuList())
            {
                addrGuScr.panelAddr.Children.Add(btnCreator.btnAddAddrGu(250, 250, 70, p)); // false is Gu mode
            }
            addrGuScr.ShowDialog();
            if (addrGuScr.Data != "취소")
            {
                target.OrderData.Customer.AddrGugun = addrGuScr.Data;
            }
        }
Beispiel #9
0
        public static void CreateNewOrderScreen3(Order newOrder, short phoneLineNo, bool isExistOrder)
        {
            //this version made for PhoneLineNumber
            OrderScreen orderScreen = new OrderScreen(newOrder, phoneLineNo, isExistOrder);

            orderScreen.Closed += new EventHandler(orderScreen_Closed);

            SetOrderScreenTime();

            SetOrderScreenPosition(orderScreen);

            orderScreen.Show();
            UpdateMainUI();

            // FileManager.AddNumberToFile(newOrder.Customer.PNumberID);
        }
Beispiel #10
0
 private void OnRequestQuoteEvent(OrderScreen model)
 {
     Log.DebugFormat("Beginning RFQ");
     _quoteId = Guid.NewGuid();
     _status  = QuoteStatus.Requesting;
     _inFlightRfqQuoteDetails = new InFlightRfqQuoteDetails
     {
         QuoteId      = _quoteId,
         CurrencyPair = model.Inputs.CurrencyPair.Value,
         Notional     = model.Inputs.Notional.Value.Value
     };
     _orderDisposable.Disposable = _rfqGateway.BegingGetQuote(
         _inFlightRfqQuoteDetails.QuoteId,
         _inFlightRfqQuoteDetails.CurrencyPair,
         _inFlightRfqQuoteDetails.Notional
         );
 }
Beispiel #11
0
        public void OnPostProcessing(OrderScreen orderScreen)
        {
            var isEnabled = orderScreen.CurrencyPairs != null && orderScreen.CurrencyPairs.Count > 0 && !orderScreen.Rfq.Status.RfqInFlight();

            _currencyPair.IsEnabled = isEnabled;
            _notional.IsEnabled     = isEnabled;
            if (_notional.HasValue && _currencyPair.HasValue)
            {
                _orderSummary = string.Format(
                    "You BUY {0} {1} against {2}",
                    _notional.Value,
                    _currencyPair.Value.Base,
                    _currencyPair.Value.Counter
                    );
            }
            else
            {
                _orderSummary = "Please select both notional and currency pair above";
            }
        }
Beispiel #12
0
        internal Model.ButtonInfo btnOrderScreenInfoInTaskBar(OrderScreen screen)
        {
            string     id   = screen.OrderData.Customer.PNumberID;
            string     date = screen.OrderData.Date.ToShortTimeString();
            ButtonInfo orderScreenButton = new ButtonInfo();

            orderScreenButton.Name       = "ID" + id;
            orderScreenButton.Height     = 60;
            orderScreenButton.Width      = 315;
            orderScreenButton.Background = DataManager.AddrColor(screen.OrderData.Customer);
            if (id != null)
            {
                orderScreenButton.Content = date + "<" + screen.OrderData.PhoneLineNo.ToString() + ">" + id.ToString();
            }
            orderScreenButton.FontSize     = 25;
            orderScreenButton.FontWeight   = System.Windows.FontWeights.Heavy;
            orderScreenButton.targetScreen = screen;
            orderScreenButton.Click       += new System.Windows.RoutedEventHandler(orderScreenButton_Click);
            return(orderScreenButton);
        }
Beispiel #13
0
 public void Initialize()
 {
     _orderScreen = new OrderScreen();
 }
Beispiel #14
0
 private void OnReferenceDataReceivedEvent(OrderScreen model)
 {
     Log.DebugFormat("Applying reference data symbols");
     _currencyPair.Items.AddRange(model.CurrencyPairs);
 }
Beispiel #15
0
 public void SetScreen(OrderScreen order)
 {
     screen = order;
 }