private void LDNDCheckFormNewLoad(object sender, EventArgs e)
 {
     _animatedThreadWorker.RunWorkerAsync();
 }
Example #2
0
 private void DirectiveComplianceDialog_Load(object sender, EventArgs e)
 {
     _animatedThreadWorker.RunWorkerAsync();
 }
Example #3
0
        /// <summary>
        /// Метод, вызывается после добавления содежимого на отображатель(вкладку)
        /// </summary>
        /// <returns></returns>
        public override void OnInitCompletion(object sender)
        {
            AnimatedThreadWorker.RunWorkerAsync();

            base.OnInitCompletion(sender);
        }
Example #4
0
 private void ButtonOkClick(object sender, EventArgs e)
 {
     AnimatedThreadWorker.RunWorkerAsync();
 }
Example #5
0
 private void HeaderControl_ReloadButtonClick(object sender, System.EventArgs e)
 {
     AnimatedThreadWorker.RunWorkerAsync();
 }
        private void ToolStripMenuItemCloseClick(object sender, EventArgs e)
        {
            var selected = _directivesViewer.SelectedItems.ToArray();

            try
            {
                foreach (var rfq in selected)
                {
                    if (rfq.Status == WorkPackageStatus.Closed)
                    {
                        MessageBox.Show("Initional Order " + rfq.Title + " is already closed.",
                                        (string)new GlobalTermsProvider()["SystemName"], MessageBoxButtons.OK,
                                        MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                        continue;
                    }

                    rfq.Status      = WorkPackageStatus.Closed;
                    rfq.ClosingDate = DateTime.Now;
                    rfq.CloseByUser = GlobalObjects.CasEnvironment.IdentityUser.ToString();
                    rfq.ClosedById  = GlobalObjects.CasEnvironment.IdentityUser.ItemId;
                    GlobalObjects.CasEnvironment.NewKeeper.Save(rfq);

                    //var initial = _directivesViewer.SelectedItem;
                    //      var quatation = new RequestForQuotation
                    //      {
                    //       Parent = initial,
                    //       ParentType = initial.SmartCoreObjectType,
                    //       Title = initial.Title,
                    //       Description = initial.Description,
                    //       OpeningDate = initial.OpeningDate,
                    //       Author = initial.Author,
                    //       Remarks = initial.Remarks,
                    //      };

                    //      GlobalObjects.CasEnvironment.NewKeeper.Save(quatation);

                    //      var initialRecords =
                    //       GlobalObjects.CasEnvironment.NewLoader.GetObjectList<InitialOrderRecordDTO, InitialOrderRecord>(
                    //        new Filter("ParentPackageId", initial.ItemId));
                    //      var ids = initialRecords.Select(i => i.ProductId);
                    //      if (ids.Count() > 0)
                    //      {
                    //       var product =
                    //        GlobalObjects.CasEnvironment.NewLoader.GetObjectList<AccessoryDescriptionDTO, Product>(
                    //	        new Filter("ItemId", ids));
                    //       foreach (var addedInitialOrderRecord in initialRecords)
                    //        addedInitialOrderRecord.Product =
                    //	        product.FirstOrDefault(i => i.ItemId == addedInitialOrderRecord.ProductId);
                    //      }

                    //      foreach (var record in initialRecords)
                    //      {
                    //       var newquatationRecord =
                    //        new RequestForQuotationRecord(quatation.ItemId, record.Product, record.Quantity);
                    //       newquatationRecord.Priority = record.Priority;
                    //       newquatationRecord.Measure = record.Measure;
                    //       newquatationRecord.DeferredCategory = record.DeferredCategory;
                    //       newquatationRecord.CostCondition = record.CostCondition;
                    //       newquatationRecord.DestinationObjectType = record.DestinationObjectType;
                    //       newquatationRecord.DestinationObjectId = record.DestinationObjectId;
                    //       newquatationRecord.InitialReason = record.InitialReason;
                    //       newquatationRecord.Remarks = record.Remarks;
                    //       newquatationRecord.LifeLimit = new Lifelength(record.LifeLimit);
                    //       newquatationRecord.LifeLimitNotify = new Lifelength(record.LifeLimitNotify);

                    //       GlobalObjects.CasEnvironment.Keeper.Save(newquatationRecord);
                    //      }
                }
            }
            catch (Exception ex)
            {
                Program.Provider.Logger.Log("Error while saving data", ex);
                throw;
            }

            AnimatedThreadWorker.RunWorkerAsync();
        }
Example #7
0
 private void DocumentForm_Load(object sender, EventArgs e)
 {
     _animatedThreadWorker.RunWorkerAsync();
 }
Example #8
0
 private void CheckBoxAll_CheckedChanged(object sender, EventArgs e)
 {
     checkBoxAll.Enabled = false;
     AnimatedThreadWorker.RunWorkerAsync();
 }
Example #9
0
 private void MtopCompliance1_ComplianceAdded(object sender, EventArgs e)
 {
     AnimatedThreadWorker.RunWorkerAsync();
 }
Example #10
0
        private void ForecastMenuClick(object sender, EventArgs e)
        {
            List <BaseComponent> aircraftBaseDetails = null;

            if (CurrentAircraft != null)
            {
                //поиск деталей данного самолета
                aircraftBaseDetails = new List <BaseComponent>(GlobalObjects.ComponentCore.GetAicraftBaseComponents(CurrentAircraft.ItemId));
                //очистка массива данных по прогнозам
                if (aircraftBaseDetails.Count != 0)
                {
                    _currentForecast.ForecastDatas.Clear();
                }
            }
            else
            {
                _currentForecast.ForecastDatas[0].ForecastLifelength = new Lifelength(0, 0, 0);
            }

            switch ((string)sender)
            {
            case "No Forecast":
            {
            }
            break;

            case "Today":
            {
                if (aircraftBaseDetails != null)
                {
                    //составление нового массива данных по прогнозам
                    foreach (BaseComponent baseDetail in aircraftBaseDetails)
                    {
                        //определение ресурсов прогноза для каждой базовой детали
                        ForecastData forecastData =
                            new ForecastData(DateTime.Today,
                                             baseDetail,
                                             GlobalObjects.CasEnvironment.Calculator.GetCurrentFlightLifelength(baseDetail));
                        //дабавление в массив
                        _currentForecast.ForecastDatas.Add(forecastData);
                    }
                    ForecastData main = _currentForecast.GetForecastDataFrame() ??
                                        _currentForecast.ForecastDatas[0];

                    labelDateAsOf.Text =
                        "Forecast date: " + SmartCore.Auxiliary.Convert.GetDateFormat(main.ForecastDate) +
                        " Aircraft TSN/CSN: " + main.ForecastLifelength +
                        "\nAvg. utlz: " + main.AverageUtilization;
                }
            }
            break;

            case "This week":
            {
                if (aircraftBaseDetails != null)
                {
                    //составление нового массива данных по прогнозам
                    foreach (BaseComponent baseDetail in aircraftBaseDetails)
                    {
                        //определение ресурсов прогноза для каждой базовой детали
                        ForecastData forecastData =
                            new ForecastData(DateTime.Today.AddDays(7),
                                             baseDetail,
                                             GlobalObjects.CasEnvironment.Calculator.GetCurrentFlightLifelength(baseDetail));
                        //дабавление в массив
                        _currentForecast.ForecastDatas.Add(forecastData);
                    }
                    ForecastData main = _currentForecast.GetForecastDataFrame() ??
                                        _currentForecast.ForecastDatas[0];

                    labelDateAsOf.Text =
                        "Forecast date: " + SmartCore.Auxiliary.Convert.GetDateFormat(main.ForecastDate) +
                        " Aircraft TSN/CSN: " + main.ForecastLifelength +
                        "\nAvg. utlz: " + main.AverageUtilization;
                }
            }
            break;

            case "Two weeks":
            {
                if (aircraftBaseDetails != null)
                {
                    //составление нового массива данных по прогнозам
                    foreach (BaseComponent baseDetail in aircraftBaseDetails)
                    {
                        //определение ресурсов прогноза для каждой базовой детали
                        ForecastData forecastData =
                            new ForecastData(DateTime.Today.AddDays(14),
                                             baseDetail,
                                             GlobalObjects.CasEnvironment.Calculator.GetCurrentFlightLifelength(baseDetail));
                        //дабавление в массив
                        _currentForecast.ForecastDatas.Add(forecastData);
                    }
                    ForecastData main = _currentForecast.GetForecastDataFrame() ??
                                        _currentForecast.ForecastDatas[0];

                    labelDateAsOf.Text =
                        "Forecast date: " + SmartCore.Auxiliary.Convert.GetDateFormat(main.ForecastDate) +
                        " Aircraft TSN/CSN: " + main.ForecastLifelength +
                        "\nAvg. utlz: " + main.AverageUtilization;
                }
            }
            break;

            case "Month":
            {
                if (aircraftBaseDetails != null)
                {
                    //составление нового массива данных по прогнозам
                    foreach (BaseComponent baseDetail in aircraftBaseDetails)
                    {
                        //определение ресурсов прогноза для каждой базовой детали
                        ForecastData forecastData =
                            new ForecastData(DateTime.Today.AddMonths(1),
                                             baseDetail,
                                             GlobalObjects.CasEnvironment.Calculator.GetCurrentFlightLifelength(baseDetail));
                        //дабавление в массив
                        _currentForecast.ForecastDatas.Add(forecastData);
                    }
                    ForecastData main = _currentForecast.GetForecastDataFrame() ??
                                        _currentForecast.ForecastDatas[0];

                    labelDateAsOf.Text =
                        "Forecast date: " + SmartCore.Auxiliary.Convert.GetDateFormat(main.ForecastDate) +
                        " Aircraft TSN/CSN: " + main.ForecastLifelength +
                        "\nAvg. utlz: " + main.AverageUtilization;
                }
            }
            break;

            case "Custom":
            {
                if (aircraftBaseDetails != null)
                {
                    //составление нового массива данных по прогнозам
                    foreach (BaseComponent baseDetail in aircraftBaseDetails)
                    {
                        //определение ресурсов прогноза для каждой базовой детали
                        ForecastData forecastData =
                            new ForecastData(DateTime.Today,
                                             baseDetail,
                                             GlobalObjects.CasEnvironment.Calculator.GetCurrentFlightLifelength(baseDetail));
                        //дабавление в массив
                        _currentForecast.ForecastDatas.Add(forecastData);
                    }
                }
                ForecastData                main         = _currentForecast.GetForecastDataFrame() ?? _currentForecast.ForecastDatas[0];
                ForecastCustomsWriteData    form         = new ForecastCustomsWriteData(_currentForecast);
                ForecastCustomsAdvancedForm advancedForm = new ForecastCustomsAdvancedForm(_currentForecast);

                form.ShowDialog();

                if (form.DialogResult != DialogResult.OK && form.CallAdvanced)
                {
                    advancedForm.ShowDialog();
                }

                if (form.DialogResult == DialogResult.OK || advancedForm.DialogResult == DialogResult.OK)
                {
                    if (CurrentAircraft != null)
                    {
                        labelDateAsOf.Text =
                            "Forecast date: " + SmartCore.Auxiliary.Convert.GetDateFormat(main.ForecastDate) +
                            " Aircraft TSN/CSN: " + main.ForecastLifelength +
                            "\nAvg. utlz: " + main.AverageUtilization;
                    }
                    else
                    {
                        labelDateAsOf.Text =
                            "Forecast date: " + SmartCore.Auxiliary.Convert.GetDateFormat(main.ForecastDate) +
                            " Component TSN/CSN: " + main.ForecastLifelength +
                            "\nAvg. utlz: " + main.AverageUtilization;
                    }
                }
                else
                {
                    return;
                }
            }
            break;
            }

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

            AnimatedThreadWorker.RunWorkerAsync();
        }
Example #11
0
        private void _toolStripMenuItemPublish_Click(object sender, EventArgs e)
        {
            if (_directivesViewer.SelectedItems.Count == 0)
            {
                return;
            }

            if (_directivesViewer.SelectedItems[0] is RequestForQuotation)
            {
                var editForm = new CreatePurchaseOrderForm(_directivesViewer.SelectedItems[0] as RequestForQuotation);
                if (editForm.ShowDialog() == DialogResult.OK)
                {
                    MessageBox.Show("Create purchase successful", "Message infomation", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);

                    foreach (var rfq in _directivesViewer.SelectedItems)
                    {
                        if (rfq.Status == WorkPackageStatus.Published)
                        {
                            MessageBox.Show("Initional Order " + rfq.Title + " is already publisher.",
                                            (string)new GlobalTermsProvider()["SystemName"], MessageBoxButtons.OK,
                                            MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                            continue;
                        }

                        rfq.Status          = WorkPackageStatus.Published;
                        rfq.PublishingDate  = DateTime.Now;
                        rfq.PublishedByUser = GlobalObjects.CasEnvironment.IdentityUser.ToString();
                        rfq.PublishedById   = GlobalObjects.CasEnvironment.IdentityUser.ItemId;
                        GlobalObjects.CasEnvironment.NewKeeper.Save(rfq as BaseEntityObject);

                        SendQuotationOrder(rfq as RequestForQuotation);
                    }
                }
                AnimatedThreadWorker.RunWorkerAsync();
            }
            else if (_directivesViewer.SelectedItems[0] is InitialOrder)
            {
                var initial   = _directivesViewer.SelectedItems[0] as InitialOrder;
                var quatation = new RequestForQuotation
                {
                    Parent      = initial,
                    ParentType  = initial.SmartCoreObjectType,
                    Title       = initial.Title,
                    OpeningDate = DateTime.Now,
                    Author      = initial.Author,
                    Remarks     = initial.Remarks,
                    Number      = initial.Number,
                };

                GlobalObjects.CasEnvironment.NewKeeper.Save(quatation);

                var initialRecords = GlobalObjects.CasEnvironment.NewLoader.GetObjectList <InitialOrderRecordDTO, InitialOrderRecord>(new Filter("ParentPackageId", initial.ItemId));
                var ids            = initialRecords.Select(i => i.ProductId);
                if (ids.Count() > 0)
                {
                    var product = GlobalObjects.CasEnvironment.NewLoader.GetObjectList <AccessoryDescriptionDTO, Product>(new Filter("ItemId", ids));
                    foreach (var addedInitialOrderRecord in initialRecords)
                    {
                        addedInitialOrderRecord.Product = product.FirstOrDefault(i => i.ItemId == addedInitialOrderRecord.ProductId);
                    }
                }

                foreach (var record in initialRecords)
                {
                    var newquatationRecord = new RequestForQuotationRecord(quatation.ItemId, record.Product, record.Quantity);
                    newquatationRecord.Priority              = record.Priority;
                    newquatationRecord.Measure               = record.Measure;
                    newquatationRecord.DeferredCategory      = record.DeferredCategory;
                    newquatationRecord.CostCondition         = record.CostCondition;
                    newquatationRecord.DestinationObjectType = record.DestinationObjectType;
                    newquatationRecord.DestinationObjectId   = record.DestinationObjectId;
                    newquatationRecord.Remarks               = record.Remarks;
                    newquatationRecord.LifeLimit             = new Lifelength(record.LifeLimit);
                    newquatationRecord.LifeLimitNotify       = new Lifelength(record.LifeLimitNotify);

                    GlobalObjects.CasEnvironment.Keeper.Save(newquatationRecord);
                }

                initial.Status          = WorkPackageStatus.Published;
                initial.PublishingDate  = DateTime.Now;
                initial.PublishedByUser = GlobalObjects.CasEnvironment.IdentityUser.ToString();
                initial.PublishedById   = GlobalObjects.CasEnvironment.IdentityUser.ItemId;
                GlobalObjects.CasEnvironment.NewKeeper.Save(initial);

                var form = new QuatationOrderFormNew(quatation);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    MessageBox.Show("Create quatation successful", "Message infomation", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                }
                AnimatedThreadWorker.RunWorkerAsync();
            }
            else if (_directivesViewer.SelectedItems[0] is PurchaseOrder)
            {
                var purch = _directivesViewer.SelectedItem as PurchaseOrder;
                //var form = new MoveProductForm(purch);
                //if (form.ShowDialog() == DialogResult.OK)
                //{
                purch.Status          = WorkPackageStatus.Published;
                purch.PublishingDate  = DateTime.Now;
                purch.PublishedByUser = GlobalObjects.CasEnvironment.IdentityUser.ToString();
                purch.PublishedById   = GlobalObjects.CasEnvironment.IdentityUser.ItemId;
                GlobalObjects.CasEnvironment.NewKeeper.Save(purch);
                SendPurchaseOrder(purch);
                //}
                AnimatedThreadWorker.RunWorkerAsync();
            }
        }
Example #12
0
 private void LLPLifeLimitChanged(object sender, EventArgs e)
 {
     AnimatedThreadWorker.RunWorkerAsync();
 }
Example #13
0
 private void SchedulePeriodForm_Load(object sender, EventArgs e)
 {
     _animatedThreadWorker.RunWorkerAsync();
 }
Example #14
0
 private void PlanOpsRecordForm_Load(object sender, EventArgs e)
 {
     _animatedThreadWorker.RunWorkerAsync();
 }
Example #15
0
        private void ToolStripMenuItemCloseClick(object sender, EventArgs e)
        {
            DialogResult dlgResult = DialogResult.No;

            foreach (Request item in _directivesViewer.SelectedItems)
            {
                if (item.Status == WorkPackageStatus.Closed)
                {
                    MessageBox.Show("Request " + item.Title + " is already closed.",
                                    (string)new GlobalTermsProvider()["SystemName"], MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                    continue;
                }

                if (item.PackageItemsLoaded == false)
                {
                    GlobalObjects.PackageCore.LoadDirectivePackageItems <Request, RequestRecord>(item);
                }

                IEnumerable <RequestRecord> blockedRecords =
                    item.PackageRecords.Where(rec => rec.Task != null &&
                                              rec.Task.NextPerformances != null &&
                                              rec.Task.NextPerformances.Count > 0 &&
                                              rec.Task.NextPerformances.Any(np => np.BlockedByPackage != null &&
                                                                            np.BlockedByPackage.ItemId != item.ItemId));
                if (item.CanClose == false || blockedRecords.Any())
                {
                    string message = "This Request can not be closed";
                    foreach (RequestRecord blockedRecord in blockedRecords)
                    {
                        NextPerformance np = blockedRecord.Task.NextPerformances.First(n => n.BlockedByPackage != null);
                        message += $"\nTask: {blockedRecord.Task} blocked by request {np.BlockedByPackage}";
                    }
                    if (item.MaxClosingDate < item.MinClosingDate)
                    {
                        message +=
                            $"\nMin Closing Date: {item.MinClosingDate} better than Max Closing Date: {item.MaxClosingDate}";
                    }
                    MessageBox.Show(message, (string)new GlobalTermsProvider()["SystemName"],
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                    continue;
                }

                //AuditClosingFormNew form = new AuditClosingFormNew(item);
                //form.ShowDialog();
                //if (form.DialogResult == DialogResult.OK)
                //{
                //    dlgResult = DialogResult.OK;
                //}
            }

            //Если хотя бы одно окно возвратило DialogResult.OK
            //производится перезагрузка элементов
            if (dlgResult == DialogResult.OK)
            {
                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoWork;
                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoFilteringWork;
                AnimatedThreadWorker.DoWork += AnimatedThreadWorkerDoWork;

                AnimatedThreadWorker.RunWorkerAsync();
            }
        }
Example #16
0
 private void DocumentsControl_Reload(object sender, EventArgs e)
 {
     _needReload = true;
     AnimatedThreadWorker.RunWorkerAsync();
 }
        private void _toolStripMenuItemCreateQuatation_Click(object sender, EventArgs e)
        {
            try
            {
                var initial   = _directivesViewer.SelectedItem;
                var quatation = new RequestForQuotation
                {
                    Parent      = initial,
                    ParentType  = initial.SmartCoreObjectType,
                    Title       = initial.Title,
                    OpeningDate = DateTime.Now,
                    Author      = initial.Author,
                    Remarks     = initial.Remarks,
                    Number      = initial.Number,
                };

                GlobalObjects.CasEnvironment.NewKeeper.Save(quatation);

                var initialRecords = GlobalObjects.CasEnvironment.NewLoader.GetObjectList <InitialOrderRecordDTO, InitialOrderRecord>(new Filter("ParentPackageId", initial.ItemId));
                var ids            = initialRecords.Select(i => i.ProductId);
                if (ids.Count() > 0)
                {
                    var product = GlobalObjects.CasEnvironment.NewLoader.GetObjectList <AccessoryDescriptionDTO, Product>(new Filter("ItemId", ids));
                    foreach (var addedInitialOrderRecord in initialRecords)
                    {
                        addedInitialOrderRecord.Product = product.FirstOrDefault(i => i.ItemId == addedInitialOrderRecord.ProductId);
                    }
                }

                foreach (var record in initialRecords)
                {
                    var newquatationRecord = new RequestForQuotationRecord(quatation.ItemId, record.Product, record.Quantity);
                    newquatationRecord.Priority              = record.Priority;
                    newquatationRecord.Measure               = record.Measure;
                    newquatationRecord.DeferredCategory      = record.DeferredCategory;
                    newquatationRecord.CostCondition         = record.CostCondition;
                    newquatationRecord.DestinationObjectType = record.DestinationObjectType;
                    newquatationRecord.DestinationObjectId   = record.DestinationObjectId;
                    newquatationRecord.Remarks               = record.Remarks;
                    newquatationRecord.LifeLimit             = new Lifelength(record.LifeLimit);
                    newquatationRecord.LifeLimitNotify       = new Lifelength(record.LifeLimitNotify);

                    GlobalObjects.CasEnvironment.Keeper.Save(newquatationRecord);
                }
                MessageBox.Show("Create quatation successful", "Message infomation", MessageBoxButtons.OK,
                                MessageBoxIcon.Information);

                initial.Status          = WorkPackageStatus.Published;
                initial.PublishingDate  = DateTime.Now;
                initial.PublishedByUser = GlobalObjects.CasEnvironment.IdentityUser.ToString();
                initial.PublishedById   = GlobalObjects.CasEnvironment.IdentityUser.ItemId;
                GlobalObjects.CasEnvironment.NewKeeper.Save(initial);

                var form = new QuatationOrderFormNew(quatation);
                form.ShowDialog();
                AnimatedThreadWorker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                Program.Provider.Logger.Log("Error while saving data", ex);
                throw;
            }
        }
Example #18
0
 private void WorkPackageEmployeeForm_Load(object sender, EventArgs e)
 {
     _animatedThreadWorker.RunWorkerAsync();
 }
Example #19
0
 private void MailChatAddingForm_Load(object sender, EventArgs e)
 {
     _animatedThreadWorker.RunWorkerAsync();
 }
Example #20
0
 private void ReceiveMailForm_Load(object sender, EventArgs e)
 {
     _animatedThreadWorker.RunWorkerAsync();
 }
Example #21
0
 private void HeaderControl1ReloadRised(object sender, EventArgs e)
 {
     _worker.RunWorkerAsync();
 }
Example #22
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);
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            _animatedThreadWorker.RunWorkerAsync();
                        }
                    }
                    else if (SelectedItem.AuditCheck.WorkflowStageId == WorkFlowStage.CAP.ItemId)
                    {
                        var form = new CheckListCAPForm(SelectedItem, AuditId.Value);
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            _animatedThreadWorker.RunWorkerAsync();
                        }
                    }
                    else
                    {
                        var form = new CheckListAuditForm(SelectedItem, AuditId.Value);
                        if (form.ShowDialog() == DialogResult.OK)
                        {
                            _animatedThreadWorker.RunWorkerAsync();
                        }
                    }
                }
                else
                {
                    if (IsRevision)
                    {
                        if (SelectedItem.CheckUIType == CheckUIType.Iosa)
                        {
                            var form = new CheckListRevEditForm(SelectedItem, Revision);
                            if (form.ShowDialog() == DialogResult.OK)
                            {
                                _animatedThreadWorker.RunWorkerAsync();
                            }
                        }
                        else if (SelectedItem.CheckUIType == CheckUIType.Safa)
                        {
                            var form = new CheckListSAFARevEditForm(SelectedItem, Revision);
                            if (form.ShowDialog() == DialogResult.OK)
                            {
                                _animatedThreadWorker.RunWorkerAsync();
                            }
                        }
                        else if (SelectedItem.CheckUIType == CheckUIType.Icao)
                        {
                            var form = new CheckListRevICAOEditForm(SelectedItem, Revision);
                            if (form.ShowDialog() == DialogResult.OK)
                            {
                                _animatedThreadWorker.RunWorkerAsync();
                            }
                        }
                    }
                    else
                    {
                        if (SelectedItem.CheckUIType == CheckUIType.Iosa)
                        {
                            var form = new CheckListForm.CheckListForm(SelectedItem, _enable);
                            if (form.ShowDialog() == DialogResult.OK)
                            {
                                _animatedThreadWorker.RunWorkerAsync();
                            }
                        }
                        else if (SelectedItem.CheckUIType == CheckUIType.Safa)
                        {
                            var form = new CheckListForm.CheckListSAFAForm(SelectedItem, _enable);
                            if (form.ShowDialog() == DialogResult.OK)
                            {
                                _animatedThreadWorker.RunWorkerAsync();
                            }
                        }
                        else if (SelectedItem.CheckUIType == CheckUIType.Icao)
                        {
                            var form = new CheckListForm.CheckListICAOForm(SelectedItem, _enable);
                            if (form.ShowDialog() == DialogResult.OK)
                            {
                                _animatedThreadWorker.RunWorkerAsync();
                            }
                        }
                        else
                        {
                            e.Cancel = true;
                        }
                    }
                }

                e.Cancel = true;
            }
        }
Example #23
0
 private void MaintenanceCheckBindTaskFormLoad(object sender, EventArgs e)
 {
     _animatedThreadWorker.RunWorkerAsync();
 }
Example #24
0
        private void PerformanceControlDataWereChanged(object sender, EventArgs e)
        {
            CancelAsync();

            AnimatedThreadWorker.RunWorkerAsync();
        }
Example #25
0
 private void HeaderControlButtonReloadClick(object sender, EventArgs e)
 {
     AnimatedThreadWorker.RunWorkerAsync();
 }
Example #26
0
 private void ButtonOkClick(object sender, EventArgs e)
 {
     _directivesViewer.last.Clear();
     AnimatedThreadWorker.RunWorkerAsync();
 }
 /// <summary>
 /// Происзодит обновление отображения элементов
 /// </summary>
 private void UpdateInformation()
 {
     AnimatedThreadWorker.RunWorkerAsync();
 }
Example #28
0
        private void ToolStripMenuItemCloseClick(object sender, EventArgs e)
        {
            var dlgResult = DialogResult.No;

            foreach (var item in _directivesViewer.SelectedItems)
            {
                if (item.Status == WorkPackageStatus.Closed)
                {
                    MessageBox.Show("Work package " + item.Title + " is already closed.",
                                    (string)new GlobalTermsProvider()["SystemName"], MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
                    continue;
                }

                if (item.WorkPackageItemsLoaded == false)
                {
                    GlobalObjects.WorkPackageCore.GetWorkPackageItemsWithCalculate(item);
                }

                var blockedRecords =
                    item.WorkPakageRecords
                    .Where(rec => rec.Task != null &&
                           rec.Task.NextPerformances != null &&
                           rec.Task.NextPerformances.Count > 0 &&
                           rec.Task.NextPerformances.Where(np => np.BlockedByPackage != null &&
                                                           np.BlockedByPackage.ItemId != item.ItemId).Count() > 0);
                if (item.CanClose == false || blockedRecords.Count() > 0)
                {
                    var message = "This work package can not be closed";
                    foreach (var blockedRecord in blockedRecords)
                    {
                        var np = blockedRecord.Task.NextPerformances.First(n => n.BlockedByPackage != null);
                        message += $"\nTask: {blockedRecord.Task} blocked by work package {np.BlockedByPackage}";
                    }
                    if (item.MaxClosingDate < item.MinClosingDate)
                    {
                        message +=
                            $"\nMin Closing Date: {item.MinClosingDate} better than Max Closing Date: {item.MaxClosingDate}";
                    }
                    MessageBox.Show(message, (string)new GlobalTermsProvider()["SystemName"],
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                    continue;
                }

                var form = new WorkPackageClosingFormNew(item);
                form.ShowDialog();
                if (form.DialogResult == DialogResult.OK)
                {
                    dlgResult = DialogResult.OK;
                }
            }

            //Если хотя бы одно окно возвратило DialogResult.OK
            //производится перезагрузка элементов
            if (dlgResult == DialogResult.OK)
            {
                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoWork;
                AnimatedThreadWorker.DoWork -= AnimatedThreadWorkerDoFilteringWork;
                AnimatedThreadWorker.DoWork += AnimatedThreadWorkerDoWork;

                AnimatedThreadWorker.RunWorkerAsync();
            }
        }
Example #29
0
 void ComplianceControlComplianceAdded(object sender, EventArgs e)
 {
     AnimatedThreadWorker.RunWorkerAsync();
 }
Example #30
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;
            }
        }