Exemplo n.º 1
0
        public static List <GlobalConfig> getGlobalConfigs()
        {
            List <GlobalConfig> xConfig = new List <GlobalConfig>();

            using (SqlConnection xCon = new SqlConnection(DB.GetDBConn()))
            {
                xCon.Open();
                System.Data.IDataReader xRdr = DB.GetRS
                                                   (sqlRetrieve,
                                                   new SqlParameter[] { new SqlParameter("@Name", DBNull.Value) },
                                                   xCon);
                while (xRdr.Read())
                {
                    GlobalConfig cfg = new GlobalConfig(xRdr.FieldInt("GlobalConfigID"),
                                                        xRdr.FieldGuid("GlobalConfigGUID"),
                                                        xRdr.Field("Name"),
                                                        xRdr.Field("Description"),
                                                        xRdr.Field("ConfigValue"),
                                                        xRdr.Field("GroupName"),
                                                        xRdr.FieldBool("SuperOnly"),
                                                        xRdr.Field("ValueType"),
                                                        xRdr.FieldDateTime("CreatedOn"),
                                                        xRdr.Field("EnumValues"));

                    xConfig.Add(cfg);
                }
            }
            return(xConfig);
        }
Exemplo n.º 2
0
 public static GlobalConfig getGlobalConfig(string setting)
 {
     using (SqlConnection xCon = new SqlConnection(DB.GetDBConn()))
     {
         xCon.Open();
         //System.Data.IDataReader xRdr= DB.GetRS(sqlRetrieve, xCon);
         System.Data.IDataReader xRdr = DB.GetRS(sqlRetrieve, new SqlParameter[] { new SqlParameter("@Name", setting) }, xCon);
         while (xRdr.Read())
         {
             return(new GlobalConfig(xRdr.FieldInt("GlobalConfigID"),
                                     xRdr.FieldGuid("GlobalConfigGUID"),
                                     xRdr.Field("Name"),
                                     xRdr.Field("Description"),
                                     xRdr.Field("ConfigValue"),
                                     xRdr.Field("GroupName"),
                                     xRdr.FieldBool("SuperOnly"),
                                     xRdr.Field("ValueType"),
                                     xRdr.FieldDateTime("CreatedOn"),
                                     xRdr.Field("EnumValues")));
         }
     }
     return(null);
 }