/// <summary>
 /// 验证市价单定单信息的有效性
 /// </summary>
 /// <param name="newInfo">新定单的详细信息</param>
 /// <param name="selectedProduct">选中下单的商品</param>
 /// <param name="operateClient">该市价单定单对应的某个用户</param>
 /// <returns>验证结果</returns>
 private ValidationResult MarketOrderInfoValidation(NewMarketOrderInfo newInfo, ProductInformation selectedProduct, ClientAccount operateClient)
 {
     return OrderInfoBaseValidation(newInfo, selectedProduct, operateClient);
 }
 /// <summary>
 /// 用新市价单的详细参数信息和选中的某个商品实例化市价单消息参数实例
 /// </summary>
 /// <param name="newOrderInfo">新市价单的详细参数信息</param>
 /// <param name="selectedProduct">选中的某个商品</param>
 public MarketOrderEventArgs( NewMarketOrderInfo newOrderInfo, ProductInformation selectedProduct ) {
     NewOrderInfo = newOrderInfo;
     SelectedProduct = selectedProduct;
 }
        /// <summary>
        /// 市价单定单
        /// </summary>
        /// <param name="loginID">登陆标识</param>
        /// <param name="clientAccountName">要下单的客户账户名</param>
        /// <param name="userType">用户类型,0:交易用户,1:管理员,2:金商</param>
        /// <param name="newOrderInfo">下单的定单信息</param>
        /// <returns>ErrType</returns>
        public ErrType MarketOrder(string loginID, string clientAccountName, int userType, NewMarketOrderInfo newOrderInfo)
        {
            try
            {
                MarOrdersLn marOln = TradeConverter.ToMarOrdersLn(loginID, clientAccountName, userType, newOrderInfo);
                Marketorders result = TradeService.GetWXMarketorders(marOln,null);//null为临时指定,微交易管理端下单不考虑券
                if (!result.Result)
                    return new ErrType(ERR.SERVICE, result.Desc);

                //这里还应进行账户资金方面的处理
                return GeneralErr.Success;
            }
            catch (TimeoutException te)
            {
                FileLog.WriteLog("", Assembly.GetExecutingAssembly().GetName().Name, this.GetType().Name, new StackTrace().GetFrame(0).GetMethod().Name, te.Message); return new ErrType(ERR.EXEPTION, ErrorText.TimeoutException);
            }
            catch (Exception ex)
            {
                FileLog.WriteLog("", Assembly.GetExecutingAssembly().GetName().Name, this.GetType().Name, new StackTrace().GetFrame(0).GetMethod().Name, ex.Message);
                return new ErrType(ERR.EXEPTION, ErrorText.OperationError);
            }
        }
 public MarketOrderWindow( ) {
     InitializeComponent( );
     _newOrderInfo = new NewMarketOrderInfo( );
 }
 internal static MarOrdersLn ToMarOrdersLn( string loginID, string clientAccountName, int userType, NewMarketOrderInfo newOrderInfo ) {
     return new MarOrdersLn {
         CurrentTime = newOrderInfo.RealTimeTime,
         LoginID = loginID,
         LossPrice = newOrderInfo.StopLossPrice,
         Mac = newOrderInfo.MAC,
         MaxPrice = newOrderInfo.AllowMaxPriceDeviation,
         OrderMoney = newOrderInfo.PercentageOfDeposit,
         OrderType = ( ( int )newOrderInfo.OrderType ).ToString( CultureInfo.InvariantCulture ),
         ProductCode = newOrderInfo.ProductCode,
         ProfitPrice = newOrderInfo.StopProfitPrice,
         Quantity = newOrderInfo.Count,
         RtimePrices = newOrderInfo.RealTimePrice,
         TradeAccount = clientAccountName,
         //Todo:用户类型待处理
         //UserType = userType,
     };
 }