/// <summary>
 /// 同步交易日信息
 /// </summary>
 /// <param name="clone">同步数据源</param>
 public void Sync(TradingDayInformation clone)
 {
     AllowTrade = clone.AllowTrade;
     DescMsg    = clone.DescMsg;
     StartTime  = clone.StartTime;
     EndTime    = clone.EndTime;
     StockCode  = clone.StockCode;
 }
        /// <summary>
        /// 显示某个交易日的详细信息
        /// </summary>
        /// <param name="selected">选中的要显示的某个交易日</param>
        public void ShowTradingDayInfo(TradingDayInformation selected)
        {
            TradingDayInformation clone = (TradingDayInformation)selected.Clone();
            TradingDayWindow wnd = new TradingDayWindow
            {
                Owner = Application.Current.MainWindow,
                DataContext = clone,
            };

            if (wnd.ShowDialog() == true)
            {
                ErrType err = _businessService.ModifyTradingDayInfo(_loginID, clone);
                if (err == GeneralErr.Success)
                    selected.Sync(clone);
                else
                    MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
 /// <summary>
 /// 同步交易日信息
 /// </summary>
 /// <param name="clone">同步数据源</param>
 public void Sync( TradingDayInformation clone ) {
     AllowTrade = clone.AllowTrade;
     DescMsg = clone.DescMsg;
     StartTime = clone.StartTime;
     EndTime = clone.EndTime;
     StockCode = clone.StockCode;
 }
 /// <summary>
 /// 修改指定的交易日信息
 /// </summary>
 /// <param name="loginID">登陆标识</param>
 /// <param name="tradingDayInfo">新的交易日信息</param>
 /// <returns>ErrType</returns>
 public ErrType ModifyTradingDayInfo(string loginID, TradingDayInformation tradingDayInfo)
 {
     try
     {
         DateSet dateSet = MyConverter.ToDateSet(tradingDayInfo);
         ResultDesc result = ManagerService.ModifyDateSetEx(dateSet, loginID);
         return result.Result ? GeneralErr.Success : new ErrType(ERR.SERVICE, result.Desc);
     }
     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);
     }
 }
Пример #5
0
 internal static DateSet ToDateSet(TradingDayInformation tradingDayInfo)
 {
     return new DateSet
     {
         Weekday = ((int)tradingDayInfo.Week).ToString(),
         Starttime = tradingDayInfo.StartTime,
         Endtime = tradingDayInfo.EndTime,
         Istrade = tradingDayInfo.AllowTrade,
         Desc = tradingDayInfo.DescMsg,
         PriceCode = tradingDayInfo.StockCode,
     };
 }