public DALType getDALType(DALTypes type, object data)
        {
            object[] constructorArgs = new Object[1];
            constructorArgs[0] = data;
            DALType dalType = (DALType)Activator.CreateInstance(dict[type]);

            dalType._data = data;
            return(dalType);
        }
Exemple #2
0
        private Dictionary <double, double> readFuncFromDB()
        {
            DALTypes[] types = new DALTypes[2] {
                DALTypes.Double, DALTypes.Double
            };
            List <List <DALType> > data = dal.ReadFullTable(FUNC_TABLE, types);

            Dictionary <double, double> func = new Dictionary <double, double>();

            foreach (List <DALType> row in data)
            {
                func[(double)row[0].getData()] = (double)row[1].getData();
            }
            return(func);
        }
 private string DALTypesToDBTypesString(DALTypes t)
 {
     if (t == DALTypes.Int)
     {
         return("int");
     }
     if (t == DALTypes.Double)
     {
         return("real");
     }
     if (t == DALTypes.String)
     {
         return("varchar(50)");
     }
     return("");
 }