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()); }
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"); } }
public AreasVocabForm(AccEquipment_V2Entities dataContext) { InitializeComponent(); _dataContext = dataContext; }
public AreasTreeModelList(AccEquipment_V2Entities dataContext) { _dataContext = dataContext; ReLoadData(); }
public EquipmentPortsSelection(AccEquipment_V2Entities dataContext) { InitializeComponent(); _dataContext = dataContext; }
public PortTypesTreeModel(AccEquipment_V2Entities dataContext) { _dataContext = dataContext; LoadData(); }
public HistoryStore(bool historyEnable = true) { _store = new AccEquipment_V2Entities(); _historyEnable = historyEnable; }
public DepartmentsTreeModel(AccEquipment_V2Entities dataContext) { _dataContext = dataContext; LoadData(); }
public EquipmentListsForm(AccEquipment_V2Entities dataContext,EquipmentListTypes formType) { InitializeComponent(); _dataContext = dataContext; _formType = formType; }
public EquipmentTemplatesTreeModel(AccEquipment_V2Entities dataContext) { _dataContext = dataContext; LoadData(); }