コード例 #1
0
ファイル: Packager.cs プロジェクト: JianwenSun/mono-soc-2007
 /// <summary>
 /// Adds the macro to the package
 /// </summary>
 /// <param Name="MacroToAdd">Macro to add</param>
 public void AddMacro(Macro MacroToAdd)
 {
     _macros.Add(MacroToAdd);
 }
コード例 #2
0
ファイル: Macro.cs プロジェクト: JianwenSun/mono-soc-2007
		/// <summary>
		/// Retrieve all macroes
		/// </summary>
		/// <returns>A list of all macroes</returns>
		public static Macro[] GetAll() 
		{
			int total = int.Parse(Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(GlobalSettings.DbDSN, CommandType.Text, "select count(*) from cmsMacro").ToString());
			int count = 0;
			SqlDataReader dr = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(GlobalSettings.DbDSN, CommandType.Text, "select id from cmsMacro order by macroName");
			Macro[] retval = new Macro[total];
			while (dr.Read()) 
			{
				retval[count] =  new Macro(int.Parse(dr["id"].ToString()));
				count++;
			}
			dr.Close();
			return retval;
		}
コード例 #3
0
 /// <summary>
 /// Creates a new MacroProperty on a macro
 /// </summary>
 /// <param Name="M">The macro</param>
 /// <param Name="show">Will the editor be able to input data</param>
 /// <param Name="alias">The alias of the property</param>
 /// <param Name="name">Userfriendly MacroProperty Name</param>
 /// <param Name="propertyType">The MacroPropertyType of the property</param>
 /// <returns></returns>
 public static MacroProperty MakeNew(Macro M, bool show, string alias, string name, MacroPropertyType propertyType)
 {
     return(new MacroProperty(int.Parse(
                                  Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(GlobalSettings.DbDSN,
                                                                                           CommandType.Text, "SET NOCOUNT ON; insert into cmsMacroProperty (macro, macroPropertyHidden, macropropertyAlias, macroPropertyName, macroPropertyType) values (@macro, @show, @alias, @Name, @type) select @@identity as id", new SqlParameter("@macro", M.Id), new SqlParameter("@show", show), new SqlParameter("@alias", alias), new SqlParameter("@Name", name), new SqlParameter("@type", propertyType.Id)).ToString())));
 }
コード例 #4
0
 /// <summary>
 /// Adds the macro to the package
 /// </summary>
 /// <param Name="MacroToAdd">Macro to add</param>
 public void AddMacro(Macro MacroToAdd)
 {
     _macros.Add(MacroToAdd);
 }
コード例 #5
0
		/// <summary>
		/// Creates a new MacroProperty on a macro
		/// </summary>
		/// <param Name="M">The macro</param>
		/// <param Name="show">Will the editor be able to input data</param>
		/// <param Name="alias">The alias of the property</param>
		/// <param Name="name">Userfriendly MacroProperty Name</param>
		/// <param Name="propertyType">The MacroPropertyType of the property</param>
		/// <returns></returns>
		public static MacroProperty MakeNew(Macro M, bool show, string alias, string name, MacroPropertyType propertyType) 
		{
			return new MacroProperty( int.Parse(
				Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(GlobalSettings.DbDSN,
				CommandType.Text, "SET NOCOUNT ON; insert into cmsMacroProperty (macro, macroPropertyHidden, macropropertyAlias, macroPropertyName, macroPropertyType) values (@macro, @show, @alias, @Name, @type) select @@identity as id", new SqlParameter("@macro", M.Id), new SqlParameter("@show", show), new SqlParameter("@alias", alias), new SqlParameter("@Name", name), new SqlParameter("@type", propertyType.Id)).ToString()));
		}