Ejemplo n.º 1
0
        /// <summary>
        /// Обработчик события нажатия на кнопку создания Воздушного судна.
        /// </summary>
        private void buttonCreateAircraft_Click(object sender, EventArgs e)
        {
            try
            {
                currentOperator = operators[comboBoxOperators.SelectedIndex];

                templateAircraft = templates[comboBoxTemplates.SelectedIndex];
                templateAircraft = Program.Presenters.AircraftsPresenter.CreateTemplateCopy(
                    templateAircraft,
                    textBoxRegistrationNumber.Text,
                    textBoxSerialNumber.Text,
                    dateTimePickerManufactureDate.Value,
                    textBoxOwner.Text,
                    textBoxLineNumber.Text,
                    textBoxVariableNumber.Text,
                    textBoxModel.Text);
            }
            catch (ArgumentException argumentException)
            {
                MessageBox.Show(
                    String.Format("Invalid value of parameter {0}. {1}", argumentException.ParamName, argumentException.Message),
                    new GlobalTermsProvider()["SystemName"].ToString(),
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
                return;
            }

            Enabled = false;
            animatedThreadWorker       = new AnimatedThreadWorker(CreateAircraftFromTemplate, null, this);
            animatedThreadWorker.State = "Creating " + templateAircraft.RegistrationNumber;
            animatedThreadWorker.StartThread();
            animatedThreadWorker.WorkFinished +=
                CreateAircraftFromTemplateFinished;
        }
Ejemplo n.º 2
0
        private void linkStock_DisplayerRequested(object sender, ReferenceEventArgs e)
        {
            if (animatedStoresLoader == null)
            {
                dispatcheredMultitabControl.SetEnabledToAllEntityes(false);
                e.Cancel = true;

                animatedStoresLoader = new AnimatedThreadWorker(
                    delegate
                {
                    Program.Presenters.StoresPresenter.LoadAllStoresForOperator(currentOperator);
                },
                    this);
                animatedStoresLoader.State         = "Loading Stock";
                animatedStoresLoader.WorkFinished +=
                    delegate
                {
                    dispatcheredMultitabControl.SetEnabledToAllEntityes(true);
                    linkStock.DisplayRequested();
                };
                animatedStoresLoader.StartThread();
            }
            else
            {
                e.DisplayerText   = String.Format("{0}. Stock", currentOperator.Name);
                e.RequestedEntity = new DispatcheredStoreScreen(currentOperator);
            }
        }
Ejemplo n.º 3
0
        private void tempButton_DisplayerRequested(object sender, ReferenceEventArgs e)
        {
            tempAircraft = (Aircraft)((AircraftReferenceStatusImageLinkLabel)sender).Aircraft;


            if (animatedThreadWorker == null)
            {
                if (TaskStart != null)
                {
                    TaskStart(this, new EventArgs());
                }

                tempAircraftListItemReference = (AircraftReferenceStatusImageLinkLabel)sender;
                e.Cancel = true;

                animatedThreadWorker       = new AnimatedThreadWorker(BackgroundAircraftLoad, sender, this);
                animatedThreadWorker.State = "Loading " + tempAircraft.RegistrationNumber;
                animatedThreadWorker.StartThread();
                animatedThreadWorker.WorkFinished += animatedThreadWorker_WorkFinished;
            }
            else
            {
                e.RequestedEntity = new DispatcheredAircraftScreen(tempAircraft);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Происходит перезагрузка элементов и синхронизация с базой данных
 /// </summary>
 protected void ReloadElements()
 {
     if (animatedThreadWorker == null)
     {
         animatedThreadWorker               = new AnimatedThreadWorker(BackgroundReload, this);
         animatedThreadWorker.State         = "Reloading Aircraft General Data";
         animatedThreadWorker.WorkFinished += animatedThreadWorker_WorkFinished;
         dispatcheredMultitabControl.SetEnabledToAllEntityes(false);
         animatedThreadWorker.StartThread();
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Происходит перезагрузка элементов и синхронизация с базой данных
 /// </summary>
 protected virtual void ReloadElements()
 {
     if (animatedThreadWorker == null)
     {
         animatedThreadWorker               = new AnimatedThreadWorker(BackgroundDirectiveSourceReload, this);
         animatedThreadWorker.State         = "Reloading work packages";
         animatedThreadWorker.WorkFinished += animatedThreadWorker_WorkFinished;
         dispatcheredMultitabControl.SetEnabledToAllEntityes(false);
         animatedThreadWorker.StartThread();
     }
 }
 /// <summary>
 /// Происходит перезагрузка элементов и синхронизация с базой данных
 /// </summary>
 protected virtual void ReloadElements()
 {
     if (animatedThreadWorker == null)
     {
         animatedThreadWorker               = new AnimatedThreadWorker(BackgroundDirectiveSourceReload, this);
         animatedThreadWorker.State         = "Reloading records";
         animatedThreadWorker.WorkFinished += animatedThreadWorker_WorkFinished;
         if (BackgroundWorkStart != null)
         {
             BackgroundWorkStart(this, new EventArgs());
         }
         animatedThreadWorker.StartThread();
     }
 }
Ejemplo n.º 7
0
        private void UpdateElements(bool reloadOperator)
        {
            if (reloadOperator)
            {
                currentOperator.Reloaded -= currentOperator_Reloaded;

                dispatcheredMultitabControl.SetEnabledToAllEntityes(false);
                animatedThreadWorker               = new AnimatedThreadWorker(BackgroundReloadAircrafts, this);
                animatedThreadWorker.State         = "Reciving data";
                animatedThreadWorker.WorkFinished += animatedThreadWorker_WorkFinished;
                animatedThreadWorker.StartThread();
            }
            else
            {
                FinishedUpdateAircrafts();
            }
        }
        private void buttonAddTemplate_Click(object sender, EventArgs e)
        {
            int amount;

            if (int.TryParse(textBoxAmount.Text, out amount))
            {
                baseDetail        = baseDetail.Clone();
                baseDetail.Amount = amount;

                Enabled = false;
                animatedThreadWorker       = new AnimatedThreadWorker(CreateBaseDetailFromTemplate, null, this);
                animatedThreadWorker.State = "Creating " + baseDetail.PartNumber;
                animatedThreadWorker.StartThread();

                animatedThreadWorker.WorkFinished += FinishedCreatingBaseDetail;
            }
            else
            {
                MessageBox.Show("Invalid amout value", (string)new TermsProvider()["SystemName"], MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }