Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new datatypedefinition given its Name and the user which creates it.
        /// </summary>
        /// <param Name="u">The user who creates the datatypedefinition</param>
        /// <param Name="Text">The Name of the DataTypeDefinition</param>
        /// <returns></returns>
        public static DataTypeDefinition MakeNew(BusinessLogic.User u, string Text)
        {
            int newId = CMSNode.MakeNew(-1, _objectType, u.Id, 1, Text, Guid.NewGuid()).Id;

            Cms.BusinessLogic.datatype.controls.Factory f = new Cms.BusinessLogic.datatype.controls.Factory();
            Guid FirstControlId = f.GetAll()[0].Id;

            Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(_ConnString, CommandType.Text, "Insert into cmsDataType (nodeId, controlId, dbType) values (" + newId.ToString() + ",'" + FirstControlId.ToString() + "','Ntext')");
            return(new DataTypeDefinition(newId));
        }
Ejemplo n.º 2
0
		/// <summary>
		/// Creates a new datatypedefinition given its Name and the user which creates it.
		/// </summary>
		/// <param Name="u">The user who creates the datatypedefinition</param>
		/// <param Name="Text">The Name of the DataTypeDefinition</param>
		/// <returns></returns>
		public static DataTypeDefinition MakeNew(BusinessLogic.User u, string Text) 
		{
			int newId = CMSNode.MakeNew(-1, _objectType,u.Id,1, Text, Guid.NewGuid()).Id;
			Cms.BusinessLogic.datatype.controls.Factory f = new Cms.BusinessLogic.datatype.controls.Factory();
			Guid FirstControlId = f.GetAll()[0].Id;
			Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(_ConnString,CommandType.Text, "Insert into cmsDataType (nodeId, controlId, dbType) values (" + newId.ToString() +",'" + FirstControlId.ToString() + "','Ntext')");
			return new DataTypeDefinition(newId);
		}