示例#1
0
        /// <summary>
        /// Представляет объект Directive Treshold в виде массива байтов для хранения в базе данных
        /// </summary>
        /// <returns></returns>
        public byte[] ToBinary()
        {
            List <byte> data = new List <byte>();

            data.AddRange(FirstPerformanceSinceNew.ConvertToByteArray());
            data.AddRange(FirstNotification.ConvertToByteArray());
            data.AddRange(RepeatInterval.ConvertToByteArray());
            data.AddRange(RepeatNotification.ConvertToByteArray());
            data.AddRange(Warranty.ConvertToByteArray());
            data.AddRange(WarrantyNotification.ConvertToByteArray());
            data.Add((byte)(_performRepeatedly ? 1 : 0));
            data.Add((byte)(FirstPerformanceConditionType == ThresholdConditionType.WhicheverLater ? 1 : 0));
            data.AddRange(DbTypes.Int64ToByteArray(EffectiveDate.Ticks));
            data.AddRange(FirstPerformanceSinceEffectiveDate.ConvertToByteArray());

            return(data.ToArray());
        }