Esempio n. 1
0
        public async Task <spGet_BTC_USDT_OpenOrder_ById> spGet_BTC_USDT_OpenOrder_ById(long openOrderId)
        {
            spGet_BTC_USDT_OpenOrder_ById result =
                await _db.QueryFirstAsync <spGet_BTC_USDT_OpenOrder_ById>(
                    "Get_BTC_USDT_OpenOrder_ById",
                    new { openOrderId = openOrderId },
                    commandType : CommandType.StoredProcedure);

            return(result);
        }
Esempio n. 2
0
 public async Task spMove_BTC_USDT_FromOpenOrdersToClosedOrders(spGet_BTC_USDT_OpenOrder_ById openOrder,
                                                                string boughtUserId, ClosedOrderStatusEnum status)
 {
     try
     {
         if (openOrder.IsBuy)
         {
             await _db.ExecuteAsync(
                 "Move_BTC_USDT_FromOpenOrdersBuyToClosedOrders",
                 new
             {
                 createUserId = openOrder.CreateUserId,
                 boughtUserId = boughtUserId,
                 id           = openOrder.Id,
                 price        = openOrder.Price,
                 amount       = openOrder.Amount,
                 total        = openOrder.Total,
                 createDate   = openOrder.CreateDate,
                 status       = (int)status
             },
                 commandType : CommandType.StoredProcedure);
         }
         else
         {
             await _db.ExecuteAsync(
                 "Move_BTC_USDT_FromOpenOrdersBuyToClosedOrders",
                 new
             {
                 createUserId = openOrder.CreateUserId,
                 boughtUserId = boughtUserId,
                 id           = openOrder.Id,
                 price        = openOrder.Price,
                 amount       = openOrder.Amount,
                 total        = openOrder.Total,
                 createDate   = openOrder.CreateDate,
                 status       = (int)status
             },
                 commandType : CommandType.StoredProcedure);
         }
     }
     catch (Exception ex)
     {
     }
 }