private void TransferedDetailFormShow() { if (_transferedComponentForm != null) { _transferedComponentForm.Show(); } else { if (_removedComponents.Count > 0 || _waitRemoveConfirmComponents.Count > 0 || _installedComponents.Count > 0) { _transferedComponentForm = new TransferedComponentForm(_removedComponents.ToArray(), _removedTransfers.ToArray(), _waitRemoveConfirmComponents.ToArray(), _waitRemoveConfirmTransfers.ToArray(), _installedComponents.ToArray(), _installedTransfers.ToArray(), SmartCoreType.Supplier); _transferedComponentForm.Show(); _transferedComponentForm.Closed += TransferedComponentFormClosed; _transferedComponentForm.ButtonAddClick += TransferedComponentFormButtonAddClick; _transferedComponentForm.ButtonDeleteClick += TransferedComponentFormButtonDeleteClick; _transferedComponentForm.ButtonCancelClick += TransferedComponentFormButtonCancelClick; } } }
protected override void AnimatedThreadWorkerDoWork(object sender, DoWorkEventArgs e) { #region Загрузка элементов if (InitialDirectiveArray == null) { InitialDirectiveArray = new CommonCollection <StockComponentInfo>(); } InitialDirectiveArray.Clear(); AnimatedThreadWorker.ReportProgress(0, "load records"); try { InitialDirectiveArray.AddRange(GlobalObjects.CasEnvironment.NewLoader.GetObjectListAll <StockComponentInfoDTO, StockComponentInfo>(new Filter("StoreID", CurrentStore.ItemId), true)); } catch (Exception exception) { Program.Provider.Logger.Log("Error while load records", exception); } AnimatedThreadWorker.ReportProgress(40, "Calculate records"); try { //TODO: раньше было так я стал передавать компоненты из списка вроде быстрее но не совсем верное решение //GlobalObjects.StockCalculator.CalculateStock(InitialDirectiveArray.OfType<StockComponentInfo>(), CurrentStore); GlobalObjects.StockCalculator.CalculateStock(_resultCollection.ToArray(), InitialDirectiveArray.OfType <StockComponentInfo>()); } catch (Exception exception) { Program.Provider.Logger.Log("Error while calculate records", exception); } #region Фильтрация директив AnimatedThreadWorker.ReportProgress(70, "filter records"); FilterItems(InitialDirectiveArray, ResultDirectiveArray); if (AnimatedThreadWorker.CancellationPending) { e.Cancel = true; return; } #endregion AnimatedThreadWorker.ReportProgress(100, "Complete"); #endregion }