Beispiel #1
0
        private void AddOrder()
        {
            AppJournal.Write("MainVM", "Add order record");

            if (modeType == 2)
            {
                orderData.Add(new Order {
                    Number       = (orderData.Count + 1),
                    FirmBroker   = dataMananger.firmData,
                    Client       = dataMananger.clientData,
                    Issue        = dataMananger.issueData,
                    BottomPrice  = 0,
                    Step         = 0,
                    LastPrice    = 0,
                    CurrentPrice = 0,
                    ModeType     = dataMananger.modeData,
                    Place        = 0,
                    StartCmdName = "Запуск"
                });

                OrdersVM orderVM = new OrdersVM();
                orderVM.Orders = orderData;
                OrdersVM       = orderVM;
            }
            else if (modeType == 1)
            {
                autoOrderData.Add(new AutoOrder {
                    Number = (autoOrderData.Count + 1)
                });

                AutoOrdersVM autoOrderVM = new AutoOrdersVM();
                autoOrderVM.AutoOrders = autoOrderData;
                AutoOrdersVM           = autoOrderVM;
            }
            else
            {
                scenaryOrderData.Add(new ScenaryOrder {
                    Number = (scenaryOrderData.Count + 1), TimeWhen = DateTime.Now.ToLongTimeString()
                });

                ScenaryOrdersVM scenaryOrderVM = new ScenaryOrdersVM();
                scenaryOrderVM.ScenaryOrders = scenaryOrderData;
                ScenaryOrdersVM = scenaryOrderVM;

                if (curBroker.name == null)
                {
                    SetBroker("ALTA");
                }

                ScenaryOrdersVM.ScenaryOrders[ScenaryOrdersVM.ScenaryOrders.Count - 1].Broker.FindLast(x => x.name == curBroker.name).name = "ALTA";
                ScenaryOrdersVM.ScenaryOrders[ScenaryOrdersVM.ScenaryOrders.Count - 1].Broker.FindLast(x => x.id == curBroker.id).id       = 430;
                ScenaryOrdersVM.ScenaryOrders[ScenaryOrdersVM.ScenaryOrders.Count - 1].Broker[0].name = curBroker.name;
                ScenaryOrdersVM.ScenaryOrders[ScenaryOrdersVM.ScenaryOrders.Count - 1].Broker[0].id   = curBroker.id;
            }

            ServerLogsTxt += "Заявка добавлена\n";
        }
Beispiel #2
0
        private void AddOrder()
        {
            AppJournal.Write("MainVM", "Add order record");

            if (modeType == 2)
            {
                orderData.Add(new Order {
                    Number             = (orderData.Count + 1),
                    FirmBroker         = dataMananger.firmData,
                    SelectedFirmBroker = dataMananger.firmData.FirstOrDefault(b => b.id == curBroker.id),
                    Client             = dataMananger.clientData,
                    Issue        = dataMananger.issueData,
                    BottomPrice  = 0,
                    Step         = 10,
                    LastPrice    = 0,
                    CurrentPrice = 0,
                    ModeType     = dataMananger.modeData,
                    Place        = 0,
                    StartCmdName = "Запуск",
                    IsPrimary    = true,
                    PauseTime    = 3000
                });

                OrdersVM orderVM = new OrdersVM();
                orderVM.Orders = orderData;
                OrdersVM       = orderVM;
            }
            else if (modeType == 1)
            {
                autoOrderData.Add(new AutoOrder {
                    Number = (autoOrderData.Count + 1)
                });

                AutoOrdersVM autoOrderVM = new AutoOrdersVM();

                autoOrderVM.AutoOrders = autoOrderData;
                AutoOrdersVM           = autoOrderVM;
            }

            ServerLogsTxt += "Заявка добавлена\n";
        }