コード例 #1
0
        /// <summary>
        /// Обновляет информацию о директиве
        /// </summary>
        /// <param name="reloadDirective">Синхронизировать ли с базой данных</param>
        private void UpdateScreen(bool reloadDirective)
        {
            if (reloadDirective)
            {
                try
                {
                    directive.Reload();
                }
                catch (Exception ex)
                {
                    Program.Provider.Logger.Log("Error while loading data", ex);
                    return;
                }
            }
            statusLinkLabel.Status = (Statuses)directive.Condition;
            statusLinkLabel.Text   = "Status: " + UsefulMethods.EnumToString(statusLinkLabel.Status);

            generalInformationControl.UpdateInformation();
            referenceDataControl.UpdateItems();
            complianceDataControl.UpdateInformation();
            complianceTermsControl.UpdateInformation();
            incorporationPlaceControl.UpdateInformation();
            affectedDocumentsControl.UpdateItems();
            referenceDocumentsControl.UpdateItems();
            referenceDrawingsControl.UpdateItems();
            MJOControl.UpdateItems();
            sparePartKitControl.UpdateItems();
            consumableMaterialsControl.UpdateItems();
            equipmentToolsGSEControl.UpdateItems();
            specificNotesDataControl.UpdateInformation();
        }
コード例 #2
0
 /// <summary>
 /// ќбновл¤ет информацию об агрегате
 /// </summary>
 public void UpdateInformation()
 {
     if (currentDetail is BaseDetail)
     {
         statusLinkLabel.Status = (Statuses)((BaseDetail)currentDetail).ConditionState;
     }
     else
     {
         statusLinkLabel.Status = (Statuses)currentDetail.ConditionState;
     }
     statusLinkLabel.Text        = "Status: " + UsefulMethods.EnumToString(statusLinkLabel.Status);
     checkBoxServiceable.Checked = currentDetail.Serviceable;
     buttonDeleteDetail.Enabled  = currentDetail.HasPermission(Users.CurrentUser, DataEvent.Remove);
     checkBoxServiceable.Enabled = currentDetail.HasPermission(Users.CurrentUser, DataEvent.Update);
     if (currentDetail is BaseDetail)
     {
         flowLayoutPanelLinks.UpdateInformation();
     }
 }
コード例 #3
0
        /// <summary>
        /// Обновляет информацию о директиве
        /// </summary>
        /// <param name="reloadDirective">Синхронизировать ли с базой данных</param>
        private void UpdateScreen(bool reloadDirective)
        {
            if (reloadDirective)
            {
                try
                {
                    directive.Reload();
                }
                catch (Exception ex)
                {
                    Program.Provider.Logger.Log("Error while loading data", ex);
                    return;
                }
            }
            statusLinkLabel.Status = (Statuses)directive.Condition;
            statusLinkLabel.Text   = "Status: " + UsefulMethods.EnumToString(statusLinkLabel.Status);

            generalInformationControl.UpdateInformation();
            summaryDirectiveControl.UpdateInformation();
            complianceDirectiveControl.SetItemsArray(DisplayedRecords);
        }
コード例 #4
0
        protected virtual void SetGroupsToItems()
        {
            if (_beginGroup == null ||
                _beginGroup.ReflectedType == null ||
                _beginGroup.ReflectedType.Name != _viewedType.Name ||
                _viewedType.GetProperty(_beginGroup.Name) == null)
            {
                return;
            }

            ICollectionView view = CollectionViewSource.GetDefaultView(itemsListView);

            view.GroupDescriptions.Clear();

            foreach (ListViewItem item in ListViewItemList)
            {
                String temp;

                if (item.Tag == null)
                {
                    continue;
                }
                BaseEntityObject ob = item.Tag as BaseEntityObject;
                if (ob == null)
                {
                    continue;
                }

                //Извлечение значения
                object value = _beginGroup.GetValue(ob, null);
                //Проверка значения на null
                if (value == null)
                {
                    continue;
                }

                if (value is IDictionaryItem)
                {
                    temp = ((IDictionaryItem)value).FullName;
                }
                else if (value is BaseEntityObject)
                {
                    temp = value.ToString();
                }
                else if (value is IThreshold)
                {
                    temp = value.ToString();
                }
                else if (value is Lifelength)
                {
                    temp = value.ToString();
                }
                else if (value.GetType().IsEnum)
                {
                    temp = UsefulMethods.EnumToString((Enum)value);
                }
                else if (value is string)
                {
                    temp = (string)value;
                }
                else if (value is int)
                {
                    temp = ((int)value).ToString();
                }
                else if (value is short)
                {
                    temp = ((short)value).ToString();
                }
                else if (value is DateTime)
                {
                    temp = SmartCore.Auxiliary.Convert.GetDateFormat((DateTime)value);
                }
                else if (value is bool)
                {
                    temp = value.ToString();
                }
                else if (value is double)
                {
                    temp = ((double)value).ToString();
                }
                else
                {
                    temp = "Can't define group";
                }

                view.GroupDescriptions.Add(temp, temp);
                item.Group = itemsListView.Groups[temp];
            }
        }