示例#1
0
        private void ReferenceButtonAddDisplayerRequested(object sender, ReferenceEventArgs e)
        {
            CommonEditorForm form = new CommonEditorForm(new Hangar
            {
                Operator   = GlobalObjects.CasEnvironment.Operators[0],
                OperatorId = GlobalObjects.CasEnvironment.Operators[0].ItemId
            });

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (form.CurrentObject as Hangar == null)
                {
                    e.Cancel = true;
                    return;
                }
                Hangar s = form.CurrentObject as Hangar;

                _itemsollection.Add(s);
                FillUiElementsFromCollection();

                //e.TypeOfReflection = ReflectionTypes.DisplayInNew;
                //e.DisplayerText = s.Name;
                //e.RequestedEntity = new StoreScreen(s);

                e.Cancel = true;
                //CommonEditorForm editorForm = new CommonEditorForm(s);
                //editorForm.ShowDialog();
            }
            else
            {
                e.Cancel = true;
            }
        }
示例#2
0
        private void ButtonAddAtlbClick(object sender, EventArgs e)
        {
            var newATLB           = new ATLB(CurrentAircraft);
            CommonEditorForm form = new CommonEditorForm(newATLB);

            form.ShowDialog();
            if (newATLB.ItemId <= 0)
            {
                return;
            }
            buttonAddAtlb.Enabled = false;

            _currentFlight.ATLBId       = newATLB.ItemId;         //присваивание идентификатора бортового журнала
            _currentFlight.AttachedFile = newATLB.AttachedFile;   //присваивание идентификатора файла бортового журнала
            _currentFlight.ParentATLB   = newATLB;                //присваивание обратной ссылки на объект бортового журнала
            _currentFlight.AircraftId   = CurrentAircraft.ItemId; //присваивание обратной на родительский самолет

            _currentAtlb = newATLB;

            var flights = GlobalObjects.AircraftFlightsCore.GetAircraftFlightsByAircraftId(CurrentAircraft.ItemId);

            var lastAircraftFlight = _currentFlight.ItemId <= 0
                                ? flights.GetLast()
                                : flights.GetPreviousKnownRecord(_currentFlight.FlightDate);

            if (lastAircraftFlight != null)
            {
                labelDateAsOf.Text = "Current ATLB: " + newATLB.ATLBNo +
                                     " Previous Page No: " + lastAircraftFlight.PageNo;
            }
        }
        private void ButtonAddDisplayerRequested(object sender, ReferenceEventArgs e)
        {
            CommonEditorForm form = new CommonEditorForm(new Specialization());

            if (form.ShowDialog() == DialogResult.OK)
            {
                AnimatedThreadWorker.RunWorkerAsync();
            }
        }
示例#4
0
        private void HeaderControlButtonEditClick(object sender, EventArgs e)
        {
            CommonEditorForm dlg = new CommonEditorForm(_currentATLB);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                UpdateTitle();
            }
        }
示例#5
0
        protected override void FillDisplayerRequestedParams(ReferenceEventArgs e)
        {
            var form = new CommonEditorForm(SelectedItem);

            if (form.ShowDialog() == DialogResult.OK)
            {
                _animatedThreadWorker.RunWorkerAsync();
            }
            e.Cancel = true;
        }
示例#6
0
        private void AddNew()
        {
            ATLB             newATLB = new ATLB(CurrentAircraft);
            CommonEditorForm form    = new CommonEditorForm(newATLB);

            form.ShowDialog();
            if (newATLB.ItemId > 0)
            {
                AnimatedThreadWorker.RunWorkerAsync();
            }
        }
示例#7
0
        private void ButtonAddDisplayerRequested(object sender, ReferenceEventArgs e)
        {
            var form = new CommonEditorForm(new SmartCore.CAA.Tasks.CAATask()
            {
                OperatorId = _operatorId
            });

            if (form.ShowDialog() == DialogResult.OK)
            {
                AnimatedThreadWorker.RunWorkerAsync();
            }
        }
示例#8
0
        private void ToolStripMenuItemPropertiesClick(object sender, EventArgs e)
        {
            //ATLBForm form = new ATLBForm(_directivesViewer.SelectedItem);
            //form.ShowDialog();

            var form = new CommonEditorForm(_directivesViewer.SelectedItem);

            if (form.ShowDialog() == DialogResult.OK)
            {
                AnimatedThreadWorker.RunWorkerAsync();
            }
        }
示例#9
0
        private void ReferenceButtonAddDisplayerRequested(object sender, ReferenceEventArgs e)
        {
            //e.TypeOfReflection = ReflectionTypes.DisplayFewPages;

            //TemplateAircraftAddToDataBaseForm form =
            //    new TemplateAircraftAddToDataBaseForm(GlobalObjects.CasEnvironment.Operators[0]);
            //DialogResult formResult = form.ShowDialog();

            //if (formResult == DialogResult.OK)
            //{
            //    _itemsCollection.Add(form.TransferedAircraft);
            //    FillUiElementsFromCollection();

            //    e.TypeOfReflection = ReflectionTypes.DisplayInNew;
            //    e.DisplayerText = form.TransferedAircraft.RegistrationNumber;
            //    //e.RequestedEntity = new DispatcheredAircraftScreen(form.TransferedAircraft);
            //    e.RequestedEntity = new AircraftScreen(form.TransferedAircraft);
            //}
            //else
            //{
            //    e.Cancel = true;
            //}

            //StoreForm form = new StoreForm(GlobalObjects.CasEnvironment.Operators[0]);
            CommonEditorForm form = new CommonEditorForm(new Vehicle
            {
                Operator   = GlobalObjects.CasEnvironment.Operators[0],
                OperatorId = GlobalObjects.CasEnvironment.Operators[0].ItemId
            });

            if (form.ShowDialog() == DialogResult.OK)
            {
                if (form.CurrentObject as Vehicle == null)
                {
                    e.Cancel = true;
                    return;
                }
                Vehicle s = form.CurrentObject as Vehicle;

                _itemsCollection.Add(s);
                FillUiElementsFromCollection();

                e.Cancel = true;

                //e.TypeOfReflection = ReflectionTypes.DisplayInNew;
                //e.DisplayerText = s.Name;
                //e.RequestedEntity = new StoreScreen(s);
            }
            else
            {
                e.Cancel = true;
            }
        }
示例#10
0
        private void TempButtonDisplayerRequested(object sender, ReferenceEventArgs e)
        {
            Hangar s = ((ReferenceStatusImageLinkLabel)sender).Tag as Hangar;

            //Keyboard k = new Keyboard();
            //if (k.ShiftKeyDown && e.TypeOfReflection == ReflectionTypes.DisplayInCurrent) e.TypeOfReflection = ReflectionTypes.DisplayInNew;
            //e.RequestedEntity = new StoreScreen(s);

            e.Cancel = true;
            CommonEditorForm editorForm = new CommonEditorForm(s);

            editorForm.ShowDialog();
        }
示例#11
0
        private void ToolStripMenuItemEditClick(object sender, EventArgs e)
        {
            if (_directivesViewer.SelectedItems.Count == 1)
            {
                CommonEditorForm form = new CommonEditorForm(_directivesViewer.SelectedItem);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoWork;
                    AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoFilteringWork;
                    AnimatedThreadWorker.DoWork += AnimatedThreadWorkerDoWork;

                    AnimatedThreadWorker.RunWorkerAsync();
                }
            }
        }
示例#12
0
        ///// <summary>
        ///// Устанавливает заголовки
        ///// </summary>
        //protected override void SetHeaders()
        //{
        //}
        #endregion

        #region protected override SetGroupsToItems()
        //protected override void SetGroupsToItems()
        //{
        //}

        #endregion

        #region protected override void SetItemColor(ListViewItem listViewItem, Specialization item)
        //protected override void SetItemColor(ListViewItem listViewItem, Specialization item)
        //{
        //}
        #endregion

        #region protected override ListViewItem.ListViewSubItem[] GetListViewSubItems(Specialization item)

        //protected override ListViewItem.ListViewSubItem[] GetListViewSubItems(Specialization item)
        //{

        //}

        #endregion

        #region protected override void SortItems(int columnIndex)

        //protected override void SortItems(int columnIndex)
        //{
        //}

        #endregion

        #region protected override void FillDisplayerRequestedParams(ReferenceEventArgs e)

        protected override void FillDisplayerRequestedParams(ReferenceEventArgs e)
        {
            if (SelectedItem != null)
            {
                e.Cancel = true;
                var form = new CommonEditorForm(SelectedItem);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    var subs = GetListViewSubItems(SelectedItem);
                    for (int i = 0; i < subs.Count; i++)
                    {
                        radGridView1.SelectedRows[0].Cells[i].Value = subs[i].Text;
                    }
                }
            }
        }
示例#13
0
        private void ButtonAddDisplayerRequested(object sender, ReferenceEventArgs e)
        {
            Request workOrder = new Request {
                Parent = CurrentOperator, ParentId = CurrentOperator.ItemId
            };
            CommonEditorForm form = new CommonEditorForm(workOrder);

            if (form.ShowDialog() == DialogResult.OK)
            {
                e.DisplayerText   = workOrder.Title;
                e.RequestedEntity = new RequestScreen(workOrder);

                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoWork;
                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoFilteringWork;
                AnimatedThreadWorker.DoWork += AnimatedThreadWorkerDoWork;

                AnimatedThreadWorker.RunWorkerAsync();
            }
        }
示例#14
0
        private void TempButtonDisplayerRequested(object sender, ReferenceEventArgs e)
        {
            Vehicle vehicle = ((ReferenceStatusImageLinkLabel)sender).Tag as Vehicle;

            if (vehicle == null)
            {
                e.Cancel = true;
                return;
            }

            e.Cancel = true;
            CommonEditorForm editorForm = new CommonEditorForm(vehicle);

            editorForm.ShowDialog();

            //Keyboard k = new Keyboard();
            //if (k.ShiftKeyDown && e.TypeOfReflection == ReflectionTypes.DisplayInCurrent) e.TypeOfReflection = ReflectionTypes.DisplayInNew;
            ////e.RequestedEntity = new DispatcheredAircraftScreen(aircraft);
            //e.RequestedEntity = new AircraftScreen(aircraft);
        }
示例#15
0
        private void EditPerformance()
        {
            if (listViewCompliance.SelectedItems.Count == 0 ||
                !(listViewCompliance.SelectedItems[0].Tag is EventTypeRiskLevelChangeRecord))
            {
                return;
            }

            CAAEventTypeRiskLevelChangeRecord changeRecord =
                listViewCompliance.SelectedItems[0].Tag as CAAEventTypeRiskLevelChangeRecord;
            CommonEditorForm form = new CommonEditorForm(changeRecord);

            if (form.ShowDialog() == DialogResult.OK)
            {
                listViewCompliance.Items[listViewCompliance.Items.IndexOf(listViewCompliance.SelectedItems[0])] =
                    new ListViewItem(GetListViewSubItems(changeRecord), null)
                {
                    Tag = changeRecord
                };
            }
        }
示例#16
0
        private void AddPerformance()
        {
            try
            {
                var newRecord =
                    new CAAEventTypeRiskLevelChangeRecord {
                    ParentEventType = _smsEventType
                };
                CommonEditorForm form = new CommonEditorForm(newRecord);

                if (form.ShowDialog() == DialogResult.OK)
                {
                    listViewCompliance.Items.Add(new ListViewItem(GetListViewSubItems(newRecord), null)
                    {
                        Tag = newRecord
                    });
                }
            }
            catch (Exception ex)
            {
                Program.Provider.Logger.Log("Error while building new object", ex);
                return;
            }
        }
示例#17
0
        private void ButtonEditClick(object sender, EventArgs e)
        {
            CommonEditorForm form = new CommonEditorForm(_currentDirective);

            form.ShowDialog();
        }