Esempio n. 1
0
        /// <summary>
        /// send order
        /// выслать ордер
        /// </summary>
        public void SendOrder(Order order)
        {
            string command = ConvertToSimpleQuikOrder(order);

            int error;
            var msg = new StringBuilder(256);

            if (command == null)
            {
                return;
            }

            order.TimeCreate = ServerTime;
            SetOrder(order);

            Trans2Quik.QuikResult result = Trans2Quik.SEND_ASYNC_TRANSACTION(command, out error, msg, msg.Capacity);

            if (msg.ToString() != "")
            {
                Order newOrder = new Order();
                newOrder.NumberUser = order.NumberUser;
                newOrder.State      = OrderStateType.Fail;
                if (MyOrderEvent != null)
                {
                    MyOrderEvent(newOrder);
                }
                return;
            }

            SendLogMessage(result.ToString(), LogMessageType.System);
        }
Esempio n. 2
0
        /// <summary>
        /// cancel order
        /// отозвать ордер
        /// </summary>
        public void CancelOrder(Order order)
        {
            string command = ConvertToKillQuikOrder(order);

            int error;
            var msg = new StringBuilder(256);


            if (command == null)
            {
                return;
            }

            Trans2Quik.QuikResult result = Trans2Quik.SEND_ASYNC_TRANSACTION(command, out error, msg, msg.Capacity);

            SendLogMessage(result.ToString(), LogMessageType.System);
        }