private void UpdateDetail(bool reloadDetail) { try { if (reloadDetail) { if (_currentDetail is BaseDetail) { _currentDetail = GlobalObjects.ComponentCore.GetFullBaseComponent(_currentDetail.ItemId); } else { _currentDetail = GlobalObjects.ComponentCore.GetDetailById(_currentDetail.ItemId); } } } catch (Exception ex) { Program.Provider.Logger.Log("Error while loading data", ex); return; } bool permission = true;//currentDetail.HasPermission(Users.CurrentUser, DataEvent.Update); _extendableRichContainerSummary.Caption = "Summary P/N:" + _currentDetail.PartNumber + " S/N:" + _currentDetail.SerialNumber + " M/T:" + _currentDetail.MaintenanceControlProcess.ShortName + " Pos:" + _currentDetail.TransferRecords.GetLast().Position; if (_baseDetailHeaderControl != null) { _baseDetailHeaderControl.UpdateInformation(); } _summaryControl.CurrentDetail = _currentDetail; //_summaryControl.UpdateInformation(); _generalDataAndPerformanceControl.CurrentDetail = _currentDetail; _generalDataAndPerformanceControl.UpdateInformation(); if (_currentDetail is BaseDetail && _detailWorkParamsControl != null) { _detailWorkParamsControl.BaseDetail = (BaseDetail)_currentDetail; _detailWorkParamsControl.UpdateInformation(); } _compliancePerformanceControl.CurrentDetail = _currentDetail; _complianceControl.CurrentDetail = _currentDetail; //_complianceControl.UpdateInformation(); headerControl.PrintButtonEnabled = DisplayedDetailRecords.Length != 0; }
private void UpdateDetail(bool reloadDetail) { try { if (reloadDetail) { if (currentDetail is BaseDetail) { currentDetail.Reload(); } } } catch (Exception ex) { Program.Provider.Logger.Log("Error while loading data", ex); return; } bool permission = currentDetail.HasPermission(Users.CurrentUser, DataEvent.Update); headerControl.ActionControl.ShowEditButton = permission; buttonAddCompliance.Enabled = (permission && currentDetail.GetDetailDirectives().Length > 0); complianceDirectiveControl_SelectedItemsChanged(complianceControl, new SelectedItemsChangeEventArgs(0)); baseDetailHeaderControl.UpdateInformation(); generalInformationControl.UpdateInformation(); compliancePerformanceControl.UpdateInformation(); warrantyControl.UpdateInformation(); easaControl.UpdateInformation(); if (!currentDetail.InUse) { storeControl.UpdateInformation(); } complianceControl.UpdateItems(); complianceControl.DoubleClickEnable = permission; headerControl.ContextActionControl.ButtonPrint.Enabled = !(DisplayedDetailRecords.Length == 0); }