示例#1
0
        /// <summary>
        /// 重置属性的值
        /// </summary>
        public void ResetProperties()
        {
            if (_orderCache == null)
            {
                ClearProperties();
            }
            else
            {
                _serialNo      = _orderCache.SerialNo;
                _groupSerialNo = _orderCache.GroupSerialNo;
                _groupPosFlag  = _orderCache.GroupPosFlag;
                _startDate     = UILogic.ConvertToDateString(_orderCache.StartDateTime);
                _startTime     = UILogic.ConvertToTimeString(_orderCache.StartDateTime.TimeOfDay);
                // 以下信息并不一定存在
                if ((_orderCache.CreateInfo != null) && (_orderCache.CreateInfo.HadInitialized))
                {
                    _creator = _orderCache.CreateInfo.Executor.ToString();
                }

                if (_orderCache.Content == null)
                {
                    _content = "";
                }
                else
                {
                    _content = _orderCache.Content.ToString();
                }

                if ((_orderCache.AuditInfo != null) && (_orderCache.AuditInfo.HadInitialized))
                {
                    _auditDate = UILogic.ConvertToDateString(_orderCache.AuditInfo.ExecuteTime);
                    _auditTime = UILogic.ConvertToTimeString(_orderCache.AuditInfo.ExecuteTime.TimeOfDay);
                    _auditor   = _orderCache.AuditInfo.Executor.ToString();
                }

                if ((_orderCache.CancelInfo != null) && (_orderCache.CancelInfo.HadInitialized))
                {
                    _cancellor = _orderCache.CancelInfo.Executor.ToString();
                }

                if ((_orderCache.ExecuteInfo != null) && (_orderCache.ExecuteInfo.HadInitialized))
                {
                    _executeDate = UILogic.ConvertToDateString(_orderCache.ExecuteInfo.ExecuteTime);
                    _executeTime = UILogic.ConvertToTimeString(_orderCache.ExecuteInfo.ExecuteTime.TimeOfDay);
                    _executor    = _orderCache.ExecuteInfo.Executor.ToString();
                }
                _state    = _orderCache.State;
                _hadSynch = _orderCache.HadSync;

                TempOrder tempTemp = _orderCache as TempOrder;
                if (tempTemp != null)
                {
                    _applySerialNo = tempTemp.ApplySerialNo;
                }
                else
                {
                    _applySerialNo = -1;
                }

                LongOrder tempLong = _orderCache as LongOrder;
                if (tempLong != null)
                {
                    if ((tempLong.CeaseInfo != null) && (tempLong.CeaseInfo.HadInitialized))
                    {
                        _ceaseDate = UILogic.ConvertToDateString(tempLong.CeaseInfo.ExecuteTime);
                        _ceaseTime = UILogic.ConvertToTimeString(tempLong.CeaseInfo.ExecuteTime.TimeOfDay);
                        _ceasor    = tempLong.CeaseInfo.Executor.ToString();
                    }

                    if ((tempLong.CeaseAuditInfo != null) && (tempLong.CeaseAuditInfo.HadInitialized))
                    {
                        _ceaseAuditorDate = UILogic.ConvertToDateString(tempLong.CeaseAuditInfo.ExecuteTime);
                        _ceaseAuditorTime = UILogic.ConvertToTimeString(tempLong.CeaseAuditInfo.ExecuteTime.TimeOfDay);
                        _ceaseAuditor     = tempLong.CeaseAuditInfo.Executor.ToString();
                    }
                }
            }
        }