static NodeDto getNodeInfo(Rbr_Db_Base pDb, NodeRow pNodeRow) { if (pNodeRow == null) { return(null); } var _platform = MapToPlatform(pDb.PlatformCollection.GetByPrimaryKey(pNodeRow.Platform_id)); return(MapToNode(pNodeRow, _platform)); }
static CdrExportMapDto getMap(Rbr_Db_Base pDb, CdrExportMapRow pCdrExportMapRow) { if (pCdrExportMapRow == null) { return(null); } CdrExportMapDetailRow[] _cdrExportMapDetailRows = pDb.CdrExportMapDetailCollection.GetByMap_id(pCdrExportMapRow.Map_id); CdrExportMapDto _cdrExportMap = MapToCdrExportMap(pCdrExportMapRow); _cdrExportMap.CdrExportMapDetails = MapToCdrExportMapDetails(_cdrExportMapDetailRows); return(_cdrExportMap); }
static void validateRole(Rbr_Db_Base pDb, NodeRow pNodeRow) { if (pNodeRow.NodeRole == NodeRole.Admin) { var _siteNodes = pDb.NodeCollection.GetByPlatform_id(pNodeRow.Platform_id); foreach (var _node in _siteNodes) { if (_node.NodeRole == NodeRole.Admin) { throw new ApplicationException("Error: Only one node per Platform can have role: Admin"); } } } }
static void updatePrioritiesManual(Rbr_Db_Base pDb, int pRoutingPlanId, int pRouteId) { var _terminationChoiceRows = pDb.TerminationChoiceCollection.GetByRoutingPlanIdRouteId_OrderByPriority(pRoutingPlanId, pRouteId); var _priority = byte.MaxValue; foreach (var _termChoice in _terminationChoiceRows) { _termChoice.Priority = _priority--; pDb.TerminationChoiceCollection.UpdateInternal(_termChoice); } _priority = 0; foreach (var _termChoice in _terminationChoiceRows) { _termChoice.Priority = ++_priority; pDb.TerminationChoiceCollection.UpdateInternal(_termChoice); } }
static void addPlatform(Rbr_Db_Base pDb, PlatformRow pPlatform) { pDb.PlatformCollection.Insert(pPlatform); }
//------------------- privates ------------------------------------------------ static int getNodeCount(Rbr_Db_Base pDb) { return(pDb.NodeCollection.GetCountAll()); }