Exemple #1
0
        //----------------------------------------------------------------
        public IEnumerable <string> GetEntities(string strIdTable, DateTime dataStart, DateTime dataEnd)
        {
            HashSet <string>        setIds = new HashSet <string>();
            COptimizedDataRoomTable table  = m_optimizedDb.GetTable(strIdTable);

            if (table != null)
            {
                strIdTable = table.TableId;
            }
            CListeEntitesDeMemoryDb <CDataRoom> lstRooms = new CListeEntitesDeMemoryDb <CDataRoom>(m_database);

            foreach (CDataRoom room in lstRooms)
            {
                try
                {
                    IDataRoomServer srv = GetRoomServer(room);
                    if (srv != null)
                    {
                        IEnumerable <string> lst = srv.GetEntitiesDirect(strIdTable, dataStart, dataEnd);
                        if (lst != null)
                        {
                            foreach (string strId in lst)
                            {
                                setIds.Add(strId);
                            }
                        }
                    }
                }
                catch { }
            }
            return(setIds);
        }
        //---------------------------------------------------------------
        public COptimizedDataRoomTable GetTable(string strTable)
        {
            COptimizedDataRoomTable table = null;

            if (!m_dicIdTableToTable.TryGetValue(strTable, out table))
            {
                m_dicNomTableToTable.TryGetValue(strTable, out table);
            }
            return(table);
        }
 //---------------------------------------------------------------
 public CDataRoomOptimizedDataBase(CDataHotel dataHotel)
 {
     if (dataHotel != null)
     {
         foreach (CDataHotelTable table in dataHotel.Tables)
         {
             COptimizedDataRoomTable ot = new COptimizedDataRoomTable(table);
             m_dicNomTableToTable[ot.TableName] = ot;
             m_dicIdTableToTable[ot.TableId]    = ot;
         }
     }
 }
Exemple #4
0
        //----------------------------------------------------------------
        public CResultAErreur SendDataDirect(string strIdTable, string strIdChamp, string strIdEntite, DateTime dataDate, double fValue)
        {
            CResultAErreur          result = CResultAErreur.True;
            COptimizedDataRoomTable table  = m_optimizedDb.GetTable(strIdTable);

            if (table != null)
            {
                strIdTable = table.TableId;
                strIdChamp = table.GetFieldId(strIdChamp);
                if (strIdChamp != null)
                {
                    return(CDataRoomManager.Instance.SetData(strIdTable, strIdEntite, strIdChamp, dataDate, fValue));
                }
                else
                {
                    result.EmpileErreur("Unknown field '" + strIdChamp + "'");
                }
            }
            else
            {
                result.EmpileErreur("Unknown table '" + strIdTable + "'");
            }
            return(result);
        }