/// <summary> /// 用新的限价挂单的详细参数信息和选中的某个商品实例化限价单消息参数实例 /// </summary> /// <param name="info">新限价挂单的详细参数信息</param> /// <param name="selectedProduct">选中的某个商品</param> public PendingOrderEventArgs(NewPendingOrderInfo info, ProductInformation selectedProduct) { NewOrderInfo = info; SelectedProduct = selectedProduct; }
internal static OrdersLncoming ToOrdersLncoming(string loginID, string clientAccountName, int userType, NewPendingOrderInfo newOrderInfo) { return(new OrdersLncoming { CurrentTime = newOrderInfo.RealTimeTime, HoldPrice = newOrderInfo.PendingOrdersPrice, LoginID = loginID, LossPrice = newOrderInfo.StopLossPrice, Mac = newOrderInfo.MAC, OrderMoney = newOrderInfo.PercentageOfDeposit, OrderType = (( int )newOrderInfo.OrderType).ToString(CultureInfo.InvariantCulture), ProductCode = newOrderInfo.ProductCode, ProfitPrice = newOrderInfo.StopProfitPrice, Quantity = newOrderInfo.Count, RtimePrices = newOrderInfo.RealTimePrice, ValidTime = newOrderInfo.DueDate, TradeAccount = clientAccountName, //Todo:用户类型待处理 //UserType = userType, }); }
public PendingOrderWindow( ) { InitializeComponent( ); _newOrderInfo = new NewPendingOrderInfo( ); }
/// <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 PendingOrder(string loginID, string clientAccountName, int userType, NewPendingOrderInfo newOrderInfo) { try { OrdersLncoming orderLn = TradeConverter.ToOrdersLncoming(loginID, clientAccountName, userType, newOrderInfo); Orders result = TradeService.GetOrders(orderLn); 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)); } }