Beispiel #1
0
        public long[] PlaceOrdersNoReceipt(DataTable betsToPlaceData, bool wantAllOrNothing, byte withdrawSeqNo)
        {
            // First, put together collection of orders.
            SimpleOrderRequest[] orders = new SimpleOrderRequest[betsToPlaceData.Rows.Count];

            int counter = 0;
            foreach (DataRow thisBetRow in betsToPlaceData.Rows)
            {
                SimpleOrderRequest thisOrder = new SimpleOrderRequest();

                thisOrder.SelectionId = long.Parse(thisBetRow["Selection Id"].ToString());
                thisOrder.Polarity = byte.Parse(thisBetRow["Polarity"].ToString());
                thisOrder.Stake = decimal.Parse(thisBetRow["Amount"].ToString());
                thisOrder.Price = decimal.Parse(thisBetRow["Odds"].ToString());
                thisOrder.ExpectedSelectionResetCount = byte.Parse(thisBetRow["ResetCount"].ToString());
                thisOrder.ExpectedWithdrawalSequenceNumber = withdrawSeqNo;

                orders[counter++] = thisOrder;
            }

            // Add the orders to the request object.
            PlaceOrdersNoReceiptRequest request = new PlaceOrdersNoReceiptRequest();
            request.Orders = orders;
            request.WantAllOrNothingBehaviour = wantAllOrNothing;

            // Finally, call the API and return the results if successful.
            PlaceOrdersNoReceiptResponse response = _proxy.PlaceOrdersNoReceipt(request);
            if (response.ReturnStatus.Code != 0)
                throw new Exception(response.ReturnStatus.Description);

            return response.OrderHandles;
        }
Beispiel #2
0
        public long[] PlaceOrdersNoReceipt(long selectionId, byte polarity, decimal amount
			, decimal odds, byte resetCount)
        {
            SimpleOrderRequest order = new SimpleOrderRequest();
            order.SelectionId = selectionId;
            order.Polarity = polarity;
            order.Stake = amount;
            order.Price = odds;
            order.ExpectedSelectionResetCount = resetCount;

            PlaceOrdersNoReceiptRequest request = new PlaceOrdersNoReceiptRequest();
            request.Orders = new SimpleOrderRequest[1] {order};

            PlaceOrdersNoReceiptResponse response = _proxy.PlaceOrdersNoReceipt(request);
            if (response.ReturnStatus.Code != 0)
                throw new Exception(response.ReturnStatus.Description);

            return response.OrderHandles;
        }