Ejemplo n.º 1
0
 private void setup()
 {
     using (IRecordsReader dr = SqlHelper.ExecuteReader("select macro, macroPropertyHidden, macroPropertyType, macroPropertySortOrder, macroPropertyAlias, macroPropertyName from cmsMacroProperty where id = @id", SqlHelper.CreateParameter("@id", _id)))
     {
         if (dr.Read())
         {
             m_macro    = new Macro(dr.GetInt("macro"));
             _public    = dr.GetBoolean("macroPropertyHidden");
             _sortOrder = (int)dr.GetByte("macroPropertySortOrder");
             _alias     = dr.GetString("macroPropertyAlias");
             _name      = dr.GetString("macroPropertyName");
             _type      = new MacroPropertyType(dr.GetShort("macroPropertyType"));
         }
         else
         {
             throw new ArgumentException("No macro property found for the id specified");
         }
     }
 }
Ejemplo n.º 2
0
 private void setup()
 {
     using (IRecordsReader dr = SqlHelper.ExecuteReader("select macro, macroPropertyHidden, macroPropertyType, macroPropertySortOrder, macroPropertyAlias, macroPropertyName from cmsMacroProperty where id = @id", SqlHelper.CreateParameter("@id", _id)))
     {
         if (dr.Read())
         {
             m_macro = new Macro(dr.GetInt("macro"));
             _public = dr.GetBoolean("macroPropertyHidden");
             _sortOrder = (int)dr.GetByte("macroPropertySortOrder");
             _alias = dr.GetString("macroPropertyAlias");
             _name = dr.GetString("macroPropertyName");
             _type = new MacroPropertyType(dr.GetShort("macroPropertyType"));
         }
         else
         {
             throw new ArgumentException("No macro property found for the id specified");
         }
     }
 }