public EquipmentTemplatesVocabForm(AccEquipment_V2Entities dataContext)
 {
     InitializeComponent();
     _dataContext = dataContext;
     ntcElementType.ValueNeeded += (s, e) =>
     {
         var data = (EquipmentTemplate) e.Node.Tag;
         if (data != null)
         {
             e.Value = ((ElementType) data.ElementType).GetAttributeValue<DescriptionAttribute, string>(x => x.Description);
         }
     };
     ntcSubData.ValueNeeded += (s, e) =>
     {
         var data = (EquipmentTemplate)e.Node.Tag;
         if (data != null)
         {
             switch ((ElementType) data.ElementType)
             {
                 case ElementType.Device:
                     e.Value = "";
                     break;
                 case ElementType.Card:
                 case ElementType.Slot:
                 case ElementType.Port:
                     e.Value = string.Format("Позиция в элементе: {0}, Игнорировать при подсчете: {1}", data.Position, data.IgnoredCalc ? "Да" : "Нет");
                     break;
                 default:
                     throw new ArgumentOutOfRangeException();
             }
         }
     };
     msFormMenu.Items.AddRange(CreateMenu());
 }
示例#2
0
 public MainDataContexts(DataConsumers consumers = DataConsumers.AccountingEquipment_V2)
 {
     AccEquipmentV2Entities = new AccEquipment_V2Entities(); // { Database = { Log = Console.WriteLine } };
     NumEquipmentEntities = new Num_equipmentEntities();
     switch (consumers)
     {
         case DataConsumers.AccountingEquipment_V2:
             _customersDependencyChangeHandler = new DependencyChangeHandler(NumEquipmentEntities, NumEquipmentEntities.Customers);
             _customersDependencyChangeHandler.OnRefreshEntityEvent += () => RefreshSideLinkInfos(true);
             _accEquipmentV2EntitiesDependencyChangeHandler = new DependencyChangeHandler(AccEquipmentV2Entities,
                 new List<DbSet> {AccEquipmentV2Entities.Equipments, AccEquipmentV2Entities.EquipmentPorts});
             break;
         case DataConsumers.Events_V2:
             
             break;
         default:
             throw new ArgumentOutOfRangeException("consumers");
     }
 }
示例#3
0
 public AreasVocabForm(AccEquipment_V2Entities dataContext)
 {
     InitializeComponent();
     _dataContext = dataContext;
 }
示例#4
0
 public AreasTreeModelList(AccEquipment_V2Entities dataContext)
 {
     _dataContext = dataContext;
     ReLoadData();
 }
示例#5
0
 public EquipmentPortsSelection(AccEquipment_V2Entities dataContext)
 {
     InitializeComponent();
     _dataContext = dataContext;
 }
示例#6
0
 public PortTypesTreeModel(AccEquipment_V2Entities dataContext)
 {
     _dataContext = dataContext;
     LoadData();
 }
示例#7
0
 public HistoryStore(bool historyEnable = true)
 {
     _store = new AccEquipment_V2Entities();
     _historyEnable = historyEnable;
 }
示例#8
0
 public DepartmentsTreeModel(AccEquipment_V2Entities dataContext)
 {
     _dataContext = dataContext;
     LoadData();
 }
示例#9
0
 public EquipmentListsForm(AccEquipment_V2Entities dataContext,EquipmentListTypes formType)
 {
     InitializeComponent();
     _dataContext = dataContext;
     _formType = formType;
 }
 public EquipmentTemplatesTreeModel(AccEquipment_V2Entities dataContext)
 {
     _dataContext = dataContext;
     LoadData();
 }