Esempio n. 1
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())));
 }
Esempio n. 2
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()));
		}