示例#1
0
文件: Directive.cs 项目: jecus/Cas
 /// <summary>
 /// Создает директиву на основе шаблона
 /// </summary>
 public Directive(TemplateDirective templateDirective) : this()
 {
     ADNoFile      = templateDirective.ADNoFile;
     ADType        = templateDirective.ADType;
     Applicability = templateDirective.Applicability;
     ATAChapter    = templateDirective.ATAChapter ?? new AtaChapter {
         ItemId = -1
     };
     Cost                 = templateDirective.Cost;
     Description          = templateDirective.Description;
     DirectiveType        = templateDirective.DirectiveType;
     EngineeringOrders    = templateDirective.EngineeringOrders;
     EngineeringOrderFile = templateDirective.EngineeringOrderFile;
     Highlight            = templateDirective.Highlight;
     HiddenRemarks        = templateDirective.HiddenRemarks;
     KitRequired          = templateDirective.KitRequired;
     ManHours             = templateDirective.ManHours;
     NDTType              = templateDirective.NDTType;
     Paragraph            = templateDirective.Paragraph;
     Remarks              = templateDirective.Remarks;
     ServiceBulletinNo    = templateDirective.ServiceBulletinNo;
     ServiceBulletinFile  = templateDirective.ServiceBulletinFile;
     Title                = templateDirective.Title;
     _threshold           = templateDirective.Threshold;
     WorkType             = templateDirective.DirectiveWorkType;
 }
示例#2
0
文件: Directive.cs 项目: jecus/Cas
        /*
         *  Методы
         */

        #region public Directive()
        /// <summary>
        /// Создает директиву без дополнительной информации
        /// </summary>
        public Directive()
        {
            SmartCoreObjectType = SmartCoreType.Directive;
            // Задаем все String
            Title           = Remarks = Applicability = Description = EngineeringOrders =
                KitRequired = HiddenRemarks = "";

            ATAChapter = new AtaChapter {
                ItemId = -1
            };

            IsClosed = false;
            // Ad директива
            DirectiveType = DirectiveType.AirworthenessDirectives;
            // тип работ данной директивы
            WorkType = DirectiveWorkType.Inspection;

            // Задаем все String
            Title = Remarks = EngineeringOrders = Paragraph = KitRequired = HiddenRemarks = "";

            // Создаем объекты, чтобы они были не null
            _threshold = new DirectiveThreshold();

            // Создаем колелкции
            _performanceRecords = new BaseRecordCollection <DirectiveRecord>();
            Kits               = new CommonCollection <AccessoryRequired>();
            NDTType            = NDTType.UNK;
            PrintInWorkPackage = true;
        }
示例#3
0
 /// <summary>
 /// Конструктор создает объект типа директивы
 /// </summary>
 /// <param name="itemId"></param>
 /// <param name="categoryName"></param>
 /// <param name="aircraftModel"></param>
 /// <param name="threshold"></param>
 public DeferredCategory(Int32 itemId, String categoryName, AircraftModel aircraftModel, DirectiveThreshold threshold)
 {
     IsDeleted     = false;
     ItemId        = itemId;
     _fullName     = categoryName;
     AircraftModel = aircraftModel;
     Threshold     = threshold;
 }
示例#4
0
 /// <summary>
 /// Переводит объкт баззы данных в Lifelength
 /// </summary>
 /// <param name="o"></param>
 /// <returns></returns>
 public static DirectiveThreshold ToDirectiveThreshold(object o)
 {
     if (o == null || o == DBNull.Value)
     {
         return(null);
     }
     return(DirectiveThreshold.ConvertFromByteArray((byte[])o));
 }
        protected override void ApplyThreshold(IThreshold threshold)
        {
            if (threshold as DirectiveThreshold == null)
            {
                MessageBox.Show(
                    "тип переданного порогового значения не соответстует типу порогового значения данного ЭУ",
                    "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            DirectiveThreshold dirThresh = threshold as DirectiveThreshold;

            // First Performance
            radio_FirstWhicheverLast.Checked =
                dirThresh.FirstPerformanceConditionType == ThresholdConditionType.WhicheverFirst ? false : true;

            if (dirThresh.FirstPerformanceSinceNew != null)
            {
                lifelengthViewer_SinceNew.Lifelength = dirThresh.FirstPerformanceSinceNew;
            }

            if (dirThresh.FirstPerformanceSinceEffectiveDate != null)
            {
                lifelengthViewer_SinceEffDate.Lifelength = dirThresh.FirstPerformanceSinceEffectiveDate;
            }

            if (dirThresh.FirstNotification != null)
            {
                lifelengthViewer_FirstNotify.Lifelength = dirThresh.FirstNotification;
            }

            // Repeat Interval
            radio_RepeatWhicheverLast.Checked =
                dirThresh.RepeatPerformanceConditionType == ThresholdConditionType.WhicheverFirst ? false : true;
            // Выбираем способ повторения директивы
            if (threshold.PerformRepeatedly)
            {
                checkBoxRepeat.Checked = true;
            }
            else
            {
                checkBoxRepeat.Checked = false;
            }

            radio_RepeatWhicheverFirst.Enabled  = radio_RepeatWhicheverLast.Enabled =
                lifelengthViewer_Repeat.Enabled = lifelengthViewer_RepeatNotify.Enabled = checkBoxRepeat.Checked;

            if (dirThresh.RepeatInterval != null)
            {
                lifelengthViewer_Repeat.Lifelength = dirThresh.RepeatInterval;
            }

            if (dirThresh.RepeatNotification != null)
            {
                lifelengthViewer_RepeatNotify.Lifelength = dirThresh.RepeatNotification;
            }
        }
示例#6
0
 /// <summary>
 /// Конструктор создает объект с параметрами по умолчанию
 /// </summary>
 public DeferredCategory()
 {
     IsDeleted           = false;
     SmartCoreObjectType = SmartCoreType.DeferredCategory;
     _fullName           = "";
     AircraftModel       = null;
     Threshold           = new DirectiveThreshold {
         FirstPerformanceConditionType      = ThresholdConditionType.WhicheverFirst,
         FirstPerformanceSinceEffectiveDate = Lifelength.Null, PerformSinceNew = true, PerformSinceEffectiveDate = true
     };
 }
示例#7
0
 /// <summary>
 /// Конструктор создает объект с параметрами по умолчанию
 /// </summary>
 public TemplateDefferedCategory()
 {
     IsDeleted     = false;
     ItemId        = -1;
     CategoryName  = "";
     AircraftModel = new AircraftModel {
         ItemId = -1
     };
     Threshold = new DirectiveThreshold {
         FirstPerformanceConditionType      = ThresholdConditionType.WhicheverFirst,
         FirstPerformanceSinceEffectiveDate = Lifelength.Null, PerformSinceNew = true, PerformSinceEffectiveDate = true
     };
 }
        /// <summary>
        /// Считывает все контролы и формирует один Threshold
        /// </summary>
        protected override IThreshold GetThreshold()
        {
            DirectiveThreshold threshold = new DirectiveThreshold();

            // First performance
            Lifelength sinceNew     = new Lifelength(lifelengthViewer_SinceNew.Lifelength);
            Lifelength sinceEffDate = new Lifelength(lifelengthViewer_SinceEffDate.Lifelength);

            threshold.FirstPerformanceSinceNew           = sinceNew;
            threshold.FirstPerformanceSinceEffectiveDate = sinceEffDate;

            threshold.PerformSinceNew           = sinceNew.IsNullOrZero() ? false : true;
            threshold.PerformSinceEffectiveDate = sinceEffDate.IsNullOrZero() ? false : true;

            Lifelength nfp = new Lifelength(lifelengthViewer_FirstNotify.Lifelength);

            threshold.FirstNotification = nfp;

            if (radio_FirstWhicheverFirst.Checked)
            {
                threshold.FirstPerformanceConditionType = ThresholdConditionType.WhicheverFirst;
            }
            if (radio_FirstWhicheverLast.Checked)
            {
                threshold.FirstPerformanceConditionType = ThresholdConditionType.WhicheverLater;
            }

            // Repeat interval
            if (checkBoxRepeat.Checked)
            {
                // директива выполняется повторно
                Lifelength rp  = new Lifelength(lifelengthViewer_Repeat.Lifelength);
                Lifelength nrp = new Lifelength(lifelengthViewer_RepeatNotify.Lifelength);

                threshold.PerformRepeatedly  = true;
                threshold.RepeatInterval     = rp;
                threshold.RepeatNotification = nrp;

                if (radio_RepeatWhicheverFirst.Checked)
                {
                    threshold.RepeatPerformanceConditionType = ThresholdConditionType.WhicheverFirst;
                }
                if (radio_RepeatWhicheverLast.Checked)
                {
                    threshold.RepeatPerformanceConditionType = ThresholdConditionType.WhicheverLater;
                }
            }

            return(threshold);
        }