Ejemplo n.º 1
0
        protected override void FillDisplayerRequestedParams(ReferenceEventArgs e)
        {
            if (SelectedItem != null)
            {
                if (IsAuditCheck)
                {
                    if (SelectedItem.AuditCheck.WorkflowStageId == WorkFlowStage.RCA.ItemId)
                    {
                        var form = new CheckListAuditRootCaseForm(SelectedItem, AuditId.Value, SelectedItem.IsEditable);
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            _animatedThreadWorker.RunWorkerAsync();
                        }
                    }
                    else if (SelectedItem.AuditCheck.WorkflowStageId == WorkFlowStage.CAP.ItemId)
                    {
                        var form = new CheckListCAPForm(SelectedItem, AuditId.Value, SelectedItem.IsEditable);
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            _animatedThreadWorker.RunWorkerAsync();
                        }
                    }
                    else
                    {
                        var form = new CheckListAuditForm(SelectedItem, AuditId.Value, SelectedItem.IsEditable);
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            _animatedThreadWorker.RunWorkerAsync();
                        }
                    }
                }
                else
                {
                    var form = new CheckListForm.CheckListForm(SelectedItem);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        _animatedThreadWorker.RunWorkerAsync();
                    }
                }
            }


            e.Cancel = true;
        }
Ejemplo n.º 2
0
        private void ButtonAddDisplayerRequested(object sender, ReferenceEventArgs e)
        {
            var check = new CheckLists
            {
                OperatorId  = _operatorId,
                ManualId    = _manual.ItemId,
                ProgramType = ProgramType.GetItemById(_manual.ProgramTypeId)
            };

            if (check.CheckUIType == CheckUIType.Iosa)
            {
                check.Settings = new CheckListSettings()
                {
                    ProgramTypeId = _manual.ProgramType.ItemId
                };

                if (_parent.Type == RevisionType.Revision)
                {
                    check.EditionId = -1;
                    var form = new CheckListForm.CheckListForm(check, _parent.ItemId);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        AnimatedThreadWorker.RunWorkerAsync();
                    }
                }
                else
                {
                    check.EditionId = _parent.ItemId;
                    var form = new CheckListForm.CheckListForm(check);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        AnimatedThreadWorker.RunWorkerAsync();
                    }
                }
            }
            else if (check.CheckUIType == CheckUIType.Safa)
            {
                check.SettingsSafa = new CheckListSettingsSAFA()
                {
                    ProgramTypeId = _manual.ProgramType.ItemId
                };

                if (_parent.Type == RevisionType.Revision)
                {
                    check.EditionId = -1;
                    var form = new CheckListForm.CheckListSAFAForm(check, _parent.ItemId);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        AnimatedThreadWorker.RunWorkerAsync();
                    }
                }
                else
                {
                    check.EditionId = _parent.ItemId;
                    var form = new CheckListForm.CheckListSAFAForm(check);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        AnimatedThreadWorker.RunWorkerAsync();
                    }
                }
            }
            else if (check.CheckUIType == CheckUIType.Icao)
            {
                check.SettingsIcao = new CheckListICAOSettings()
                {
                    ProgramTypeId = _manual.ProgramType.ItemId
                };

                if (_parent.Type == RevisionType.Revision)
                {
                    check.EditionId = -1;
                    var form = new CheckListForm.CheckListICAOForm(check, _parent.ItemId);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        AnimatedThreadWorker.RunWorkerAsync();
                    }
                }
                else
                {
                    check.EditionId = _parent.ItemId;
                    var form = new CheckListForm.CheckListICAOForm(check);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        AnimatedThreadWorker.RunWorkerAsync();
                    }
                }
            }
            else
            {
                MessageBox.Show($"For ProgramType:{_manual.ProgramType} form not found!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                e.Cancel = true;
            }
        }