Exemplo n.º 1
0
        //-----------------------------------------------------------
        public void CreateNew(string strId)
        {
            DataTable table = m_database.GetTable(GetType());

            m_row = new CMemoryDataRow(table.NewRow());
            m_row[GetChampId()] = strId;
            InitValeursParDefaut();
            table.Rows.Add(m_row.Row);
        }
Exemplo n.º 2
0
        //-----------------------------------------------------------
        public bool ReadIfExist(CFiltreMemoryDb filtre)
        {
            DataTable table = m_database.GetTable(GetType());

            DataRow[] rows = table.Select(filtre.GetFiltreDataTable());
            if (rows.Length > 0)
            {
                m_row = new CMemoryDataRow(rows[0]);
                return(true);
            }
            return(false);
        }
Exemplo n.º 3
0
        //-----------------------------------------------------------
        public bool ReadIfExist(string strId, bool bUtiliserLesSourcesExternes)
        {
            DataTable table = m_database.GetTable(GetType());
            DataRow   row   = table.Rows.Find(strId);

            if (row != null)
            {
                m_row = new CMemoryDataRow(row);
                return(true);
            }
            else if (bUtiliserLesSourcesExternes)
            {
                CEntiteDeMemoryDb entite = Database.GetElementFromFournisseurSupplementaire(GetType(), strId);
                if (entite != null)
                {
                    m_row = new CMemoryDataRow(entite.Row.Row);
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 4
0
 //-----------------------------------------------------------
 public CEntiteDeMemoryDb(DataRow row)
 {
     m_row      = new CMemoryDataRow(row);
     m_database = (CMemoryDb)m_row.Table.DataSet;
 }