public override void DisposeScreen() { if (AnimatedThreadWorker.IsBusy) { AnimatedThreadWorker.CancelAsync(); } AnimatedThreadWorker.Dispose(); _initialDirectiveArray.Clear(); _initialDirectiveArray = null; if (_toolStripMenuItemOpen != null) { _toolStripMenuItemOpen.Dispose(); } if (_toolStripSeparator1 != null) { _toolStripSeparator1.Dispose(); } if (_toolStripMenuItemHighlight != null) { _toolStripMenuItemHighlight.Dispose(); } if (_directivesViewer != null) { _directivesViewer.Dispose(); } Dispose(true); }
public TransferRecordCollection GetLastTransferRecordsFromSuppliers() { var transferRecords = _newLoader.GetObjectListAll <TransferRecordDTO, TransferRecord>(new List <Filter>() { new Filter("ParentType", SmartCoreType.Component.ItemId), new Filter("FromSupplierId", FilterType.Grather, 0), new Filter("PODR", false) }, true).OrderByDescending(t => t.TransferDate); var collection = new TransferRecordCollection(transferRecords.ToArray()); // возвращаем результат SetParents(collection); return(collection); }
///<summary> ///</summary> ///<param name="initialCollection"></param> ///<param name="resultCollection"></param> private void FilterItems(TransferRecordCollection initialCollection, TransferRecordCollection resultCollection) { if (_filter == null || _filter.All(i => i.Values.Length == 0)) { resultCollection.Clear(); resultCollection.AddRange(initialCollection.ToArray()); return; } resultCollection.Clear(); foreach (var pd in initialCollection) { if (_filter.FilterTypeAnd) { bool acceptable = true; foreach (ICommonFilter filter in _filter) { acceptable = filter.Acceptable(pd); if (!acceptable) { break; } } if (acceptable) { resultCollection.Add(pd); } } else { bool acceptable = true; foreach (ICommonFilter filter in _filter) { if (filter.Values == null || filter.Values.Length == 0) { continue; } acceptable = filter.Acceptable(pd); if (acceptable) { break; } } if (acceptable) { resultCollection.Add(pd); } } } }
public TransferRecordCollection GetPreTransferRecordsFrom(BaseComponent baseComponent) { if (baseComponent == null) { return(null); } var transferRecords = _newLoader.GetObjectListAll <TransferRecordDTO, TransferRecord>(new List <Filter>() { new Filter("DestinationObjectID", baseComponent.ItemId), new Filter("DestinationObjectType", SmartCoreType.BaseComponent.ItemId), new Filter("i.PreConfirmTransfer", true) }, true).OrderByDescending(t => t.TransferDate); var collection = new TransferRecordCollection(transferRecords.ToArray()); // возвращаем результат SetParents(collection); return(collection); }
/// <summary> /// Возвращает все записи об удалении агрегатов с данного склада /// </summary> /// <returns></returns> public TransferRecordCollection GetLastTransferRecordsFrom(Store store, SmartCoreType componentType) { if (store == null) { return(null); } var transferRecords = _newLoader.GetObjectListAll <TransferRecordDTO, TransferRecord>(new List <Filter>() { new Filter("ParentType", componentType.ItemId), new Filter("FromStoreID", store.ItemId), new Filter("PODR", false) }, true).OrderByDescending(t => t.TransferDate); var collection = new TransferRecordCollection(transferRecords.ToArray()); // возвращаем результат SetParents(collection); return(collection); }
/// <summary> /// Возвращает все записи об удалении агрегатов с данного базового агрегата /// </summary> /// <returns></returns> public TransferRecordCollection GetLastTransferRecordsFrom(Aircraft aircraft) { if (aircraft == null) { return(null); } var transferRecords = _newLoader.GetObjectListAll <TransferRecordDTO, TransferRecord>(new List <Filter>() { new Filter("FromBaseComponentID", 0), new Filter("FromAircraftID", aircraft.ItemId), new Filter("FromStoreID", 0), new Filter("PODR", false) }).OrderByDescending(t => t.TransferDate); var collection = new TransferRecordCollection(transferRecords.ToArray()); // возвращаем результат SetParents(collection); return(collection); }
/// <summary> /// Возвращает все записи об удалении агрегатов с данного базового агрегата /// </summary> /// <returns></returns> public TransferRecordCollection GetLastTransferRecordsFrom(BaseComponent baseComponent) { if (baseComponent == null) { return(null); } //if(baseComponent.ParentAircraftId > 0) // filters.Add(new CommonFilter<int>(TransferRecord.FromAircraftIdProperty, baseComponent.ParentAircraftId)); //if(baseComponent.ParentStoreId > 0) // filters.Add(new CommonFilter<int>(TransferRecord.FromStoreIdProperty, baseComponent.ParentStoreId)); var transferRecords = _newLoader.GetObjectListAll <TransferRecordDTO, TransferRecord>(new List <Filter>() { new Filter("FromBaseComponentID", baseComponent.ItemId), new Filter("PODR", false) }, true).OrderByDescending(t => t.TransferDate); var collection = new TransferRecordCollection(transferRecords.ToArray()); // возвращаем результат SetParents(collection); return(collection); }
///<summary> ///Конструктор заполняющий всю необходимую информацию о переданном объекте ///</summary> public TransferedComponentForm(IEnumerable <Component> removedDetails, IEnumerable <TransferRecord> removedTransfers, IEnumerable <Component> waitRemoveDetails, IEnumerable <TransferRecord> waitRemoveTransfers, IEnumerable <Component> installedDetails, IEnumerable <TransferRecord> installedTransfers, SmartCoreType parentType) : this() { _removedComponents = new ComponentCollection(); _removedComponents.AddRange(removedDetails); _removedTransfers = new TransferRecordCollection(); _removedTransfers.AddRange(removedTransfers); _waitremovedConfirmComponents = new ComponentCollection(); _waitremovedConfirmComponents.AddRange(waitRemoveDetails); _waitRemovedTransfers = new TransferRecordCollection(); _waitRemovedTransfers.AddRange(waitRemoveTransfers); _installedComponents = new ComponentCollection(); _installedComponents.AddRange(installedDetails); _installedTransfers = new TransferRecordCollection(); _installedTransfers.AddRange(installedTransfers); _parentType = parentType; UpdateInformation(); }
protected override void AnimatedThreadWorkerDoWork(object sender, DoWorkEventArgs e) { AnimatedThreadWorker.ReportProgress(0, "load components"); var resultCollection = new ComponentCollection(); _preResultDirectiveArray.Clear(); _resultDirectiveArray.Clear(); _removedComponents.Clear(); _removedTransfers.Clear(); _waitRemoveConfirmComponents.Clear(); _waitRemoveConfirmTransfers.Clear(); _installedComponents.Clear(); _installedTransfers.Clear(); #region Загрузка всех компонентов resultCollection = GlobalObjects.ComponentCore.GetSupplierProcessing(); ////////////////////////////////////////////////////// // проверка на установленные компоненты // ////////////////////////////////////////////////////// var lastInstalledDetails = resultCollection.GetLastInstalledComponentsOnProcessing(); foreach (var component in lastInstalledDetails) { _installedComponents.Add(component); _installedTransfers.Add(component.TransferRecords.GetLast()); //удаление данного компонента из коллекции //т.к. его отображать не нужно resultCollection.Remove(component); } ////////////////////////////////////////////////////// // проверка на удаленные компоненты // ////////////////////////////////////////////////////// //извлечение из базы данных всех записей о перемещении //компонентов с данного базового агрегата var records = new TransferRecordCollection(); records.AddRange(GlobalObjects.TransferRecordCore.GetLastTransferRecordsFromSuppliers().ToArray()); records.AddRange(GlobalObjects.TransferRecordCore.GetLastTransferRecordsFromSpecialist().ToArray()); foreach (var record in records) { //загрузка и БД детали, которой пренадлежит данная запись о перемещении var component = GlobalObjects.ComponentCore.GetComponentById(record.ParentId); if (component == null) { continue; } if (record.DODR) { //если перемещение подтверждено, то деталь записывается в "перемещенные" //окна "TransferedDetails" if (_removedComponents.CompareAndAdd(component)) { _removedTransfers.Add(record); } } else { //если перемещение не подтверждено, то деталь записывается в //"ожидабщие подтверждения" окна "TransferedDetails" if (_waitRemoveConfirmComponents.CompareAndAdd(component)) { _waitRemoveConfirmTransfers.Add(record); } } } #endregion #region Слияние компонентов в одну коллекцию AnimatedThreadWorker.ReportProgress(40, "calculation of components"); foreach (var component in resultCollection) { _preResultDirectiveArray.Add(component); } if (AnimatedThreadWorker.CancellationPending) { e.Cancel = true; return; } #endregion AdditionalFilterItems(_preResultDirectiveArray, _resultDirectiveArray); AnimatedThreadWorker.ReportProgress(100, "calculation over"); }