Exemple #1
0
 public Property(int Id, propertytype.PropertyType pt)
 {
     _pt              = pt;
     _id              = Id;
     _data            = _pt.DataTypeDefinition.DataType.Data;
     _data.PropertyId = Id;
 }
Exemple #2
0
        internal Property(Umbraco.Core.Models.Property property)
        {
            _id           = property.Id;
            _property     = property;
            _propertyType = property.PropertyType;

            //Just to ensure that there is a PropertyType available
            _pt = PropertyType.GetPropertyType(property.PropertyTypeId);

            //ensure we have data property editor set
            if (_pt.DataTypeDefinition.DataType != null)
            {
                _data = _pt.DataTypeDefinition.DataType.Data;
            }
            else
            {
                //send back null we will handle it in ContentControl AddControlNew
                //and display to use message from the dictionary errors section
                _data = new DefaultData(null);
            }

            _data.PropertyId = Id;

            //set the value so it doesn't need to go to the database
            var dvs = _data as IDataValueSetter;

            if (dvs != null)
            {
                dvs.SetValue(property.Value, property.PropertyType.DataTypeDatabaseType.ToString());
            }
        }
Exemple #3
0
 public Property(int Id)
 {
     _id = Id;
     _pt = umbraco.cms.businesslogic.propertytype.PropertyType.GetPropertyType(
         SqlHelper.ExecuteScalar <int>("select propertytypeid from cmsPropertyData where id = @id", SqlHelper.CreateParameter("@id", Id)));
     _data            = _pt.DataTypeDefinition.DataType.Data;
     _data.PropertyId = Id;
 }
Exemple #4
0
 public Property(int Id)
 {
     _id = Id;
     _pt = Umbraco.Cms.BusinessLogic.propertytype.PropertyType.GetPropertyType(int.Parse(
                                                                                   Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(GlobalSettings.DbDSN, CommandType.Text, "select propertytypeid from cmsPropertyData where id = @id", new SqlParameter("@id", Id)).ToString()));
     _data            = _pt.DataTypeDefinition.DataType.Data;
     _data.PropertyId = Id;
 }
Exemple #5
0
        public static Property MakeNew(propertytype.PropertyType pt, Content c, Guid VersionId)
        {
            int newPropertyId = int.Parse(Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(_connstring, CommandType.Text, "Insert into cmsPropertyData (contentNodeId, versionId, propertyTypeId) values (" + c.Id.ToString() + ", '" + VersionId.ToString() + "'," + pt.Id.ToString() + ") select @@identity").ToString());

            interfaces.IData d = pt.DataTypeDefinition.DataType.Data;
            d.MakeNew(newPropertyId);
            return(new Property(newPropertyId, pt));
        }
Exemple #6
0
 public Property(int Id)
 {
     _id = Id;
     _pt = umbraco.cms.businesslogic.propertytype.PropertyType.GetPropertyType(
         SqlHelper.ExecuteScalar<int>("select propertytypeid from cmsPropertyData where id = @id", SqlHelper.CreateParameter("@id", Id)));
     _data = _pt.DataTypeDefinition.DataType.Data;
     _data.PropertyId = Id;
 }
Exemple #7
0
        public Property(int Id, propertytype.PropertyType pt)
        {

            _pt = pt;
            _id = Id;
            _data = _pt.DataTypeDefinition.DataType.Data;
            _data.PropertyId = Id;
        }
Exemple #8
0
 public Property(int Id, propertytype.PropertyType pt)
 {
     _pt = pt;
     _id = Id;
     if (_pt.DataTypeDefinition.DataType == null)
     {
         throw new Exception(string.Format("Could not load datatype '{0}'", _pt.DataTypeDefinition.Text));
     }
     _data            = _pt.DataTypeDefinition.DataType.Data;
     _data.PropertyId = Id;
 }
Exemple #9
0
        internal Property(Umbraco.Core.Models.Property property)
        {
            _id           = property.Id;
            _property     = property;
            _propertyType = property.PropertyType;

            //Just to ensure that there is a PropertyType available
            _pt              = PropertyType.GetPropertyType(property.PropertyTypeId);
            _data            = _pt.DataTypeDefinition.DataType.Data;
            _data.PropertyId = Id;
        }
Exemple #10
0
        internal Property(Umbraco.Core.Models.Property property)
        {
            _id = property.Id;
            _property = property;
            _propertyType = property.PropertyType;

            //Just to ensure that there is a PropertyType available
            _pt = PropertyType.GetPropertyType(property.PropertyTypeId);
            _data = _pt.DataTypeDefinition.DataType.Data;
            _data.PropertyId = Id;
        }
Exemple #11
0
 public Property(int Id)
 {
     _id = Id;
     _pt = PropertyType.GetPropertyType(
         SqlHelper.ExecuteScalar <int>("select propertytypeid from cmsPropertyData where id = @id",
                                       SqlHelper.CreateParameter("@id", Id)));
     if (_pt.DataTypeDefinition.DataType == null)
     {
         throw new Exception(string.Format("Could not load datatype '{0}'", _pt.DataTypeDefinition.Text));
     }
     _data            = _pt.DataTypeDefinition.DataType.Data;
     _data.PropertyId = Id;
 }
Exemple #12
0
        public static Property MakeNew(propertytype.PropertyType pt, Content c, Guid versionId)
        {
            int newPropertyId = 0;

            // The method is synchronized
            SqlHelper.ExecuteNonQuery("INSERT INTO cmsPropertyData (contentNodeId, versionId, propertyTypeId) VALUES(@contentNodeId, @versionId, @propertyTypeId)",
                                      SqlHelper.CreateParameter("@contentNodeId", c.Id),
                                      SqlHelper.CreateParameter("@versionId", versionId),
                                      SqlHelper.CreateParameter("@propertyTypeId", pt.Id));
            newPropertyId = SqlHelper.ExecuteScalar <int>("SELECT MAX(id) FROM cmsPropertyData");
            interfaces.IData d = pt.DataTypeDefinition.DataType.Data;
            d.MakeNew(newPropertyId);
            return(new Property(newPropertyId, pt));
        }
Exemple #13
0
        internal Property(Umbraco.Core.Models.Property property)
        {
            _id = property.Id;
            _property = property;
            _propertyType = property.PropertyType;

            //Just to ensure that there is a PropertyType available
            _pt = PropertyType.GetPropertyType(property.PropertyTypeId);
            _data = _pt.DataTypeDefinition.DataType.Data;
            _data.PropertyId = Id;

            //set the value so it doesn't need to go to the database
            var dvs = _data as IDataValueSetter;
            if (dvs != null)
            {
                dvs.SetValue(property.Value, property.PropertyType.DataTypeDatabaseType.ToString());
            }
            
        }
Exemple #14
0
 public colorPicker(interfaces.IData Data, List <KeyValuePair <int, String> > Prevalues)
 {
     _data          = Data;
     this.Prevalues = Prevalues;
 }
		public numberField(interfaces.IData Data) 
        {
			_data = Data;
		}
		public dropdownMultiple(interfaces.IData Data,SortedList Prevalues)
		{
			_data = Data;
			_prevalues = Prevalues;
		}
		public memberPicker(interfaces.IData Data)
		{
			_data = Data;
		}
Exemple #18
0
 public dropdownMultiple(interfaces.IData Data, SortedList Prevalues)
 {
     _data      = Data;
     _prevalues = Prevalues;
 }
Exemple #19
0
 public yesNo(interfaces.IData Data)
 {
     _data = Data;
 }
Exemple #20
0
 public checkboxlistEditor(interfaces.IData Data, List <KeyValuePair <int, String> > Prevalues)
 {
     _data          = Data;
     this.Prevalues = Prevalues;
 }
Exemple #21
0
 public pagePicker(interfaces.IData data) : base(data)
 {
 }
Exemple #22
0
 public radiobox(interfaces.IData Data, List <KeyValuePair <int, String> > Prevalues)
 {
     _data          = Data;
     this.Prevalues = Prevalues;
 }
Exemple #23
0
 public dateField(interfaces.IData Data)
 {
     _data = Data;
 }
		public dictionaryPicker(interfaces.IData Data, SortedList Prevalues) 
		{
			_data = Data;
			_prevalues = Prevalues;
		}
Exemple #25
0
		public yesNo(interfaces.IData Data) {
			_data = Data;
		}
		public pagePicker(interfaces.IData Data)
		{
			_data = Data;
		}
Exemple #27
0
 public uploadField(interfaces.IData Data, string ThumbnailSizes)
 {
     _data       = (cms.businesslogic.datatype.DefaultData)Data;
     _thumbnails = ThumbnailSizes;
 }
Exemple #28
0
 public radiobox(interfaces.IData Data, SortedList Prevalues)
 {
     _data      = Data;
     _prevalues = Prevalues;
 }
Exemple #29
0
 public radiobox(interfaces.IData Data, List<KeyValuePair<int, String>> Prevalues)
 {
     _data = Data;
     this.Prevalues = Prevalues;
 }
Exemple #30
0
		public SimpleEditor(interfaces.IData Data) 
		{
			_data = Data;

		}
 public noEdit(interfaces.IData Data)
 {
     _data = Data;
 }
Exemple #32
0
 public checkboxlistEditor(interfaces.IData Data, List<KeyValuePair<int, String>> Prevalues)
 {
     _data = Data;
     this.Prevalues = Prevalues;
 }
Exemple #33
0
		public dateField(interfaces.IData Data) {
			_data = Data;
		}
Exemple #34
0
 public dictionaryPicker(interfaces.IData Data, SortedList Prevalues)
 {
     _data      = Data;
     _prevalues = Prevalues;
 }
Exemple #35
0
 public colorPicker(interfaces.IData Data, List<KeyValuePair<int, String>> Prevalues)
 {
     _data = Data;
     this.Prevalues = Prevalues;
 }
 public dropdownMultiple(interfaces.IData Data, List<KeyValuePair<int, String>> Prevalues)
 {
     _data = Data;
     this.Prevalues = Prevalues;
 }
		public checkboxlistEditor(interfaces.IData Data,SortedList Prevalues)
		{
			_data = Data;
			_prevalues = Prevalues;
		}
Exemple #38
0
 public colorPicker(interfaces.IData Data, SortedList Prevalues)
 {
     _data      = Data;
     _prevalues = Prevalues;
 }
 public mediaChooser(interfaces.IData Data)
 {
     _data = Data;
 }
Exemple #40
0
		public radiobox(interfaces.IData Data, SortedList Prevalues) 
		{
			_data = Data;
			_prevalues = Prevalues;
		}
Exemple #41
0
 public memberPicker(interfaces.IData Data)
 {
     _data = Data;
 }
Exemple #42
0
 public TextFieldEditor(interfaces.IData Data)
 {
     _data = Data;
 }
 public SimpleEditor(interfaces.IData Data)
 {
     _data = Data;
 }
 public BaseTreePickerEditor(IData Data)
     : base()
 {
     _data = Data;
 }
Exemple #45
0
 public dropdownMultiple(interfaces.IData Data, List <KeyValuePair <int, String> > Prevalues)
 {
     _data          = Data;
     this.Prevalues = Prevalues;
 }
Exemple #46
0
 public colorPicker(interfaces.IData Data, SortedList Prevalues)
 {
     _data = Data;
     _prevalues = Prevalues;
 }
Exemple #47
0
		public noEdit(interfaces.IData Data) {
			_data = Data;
		}
		public mediaChooser(interfaces.IData Data)
		{
			_data = Data;
		}
Exemple #49
0
 public numberField(interfaces.IData Data)
 {
     _data = Data;
 }
 public TextFieldEditor(interfaces.IData Data)
 {
     _data = Data;
 }
Exemple #51
0
 public checkboxlistEditor(interfaces.IData Data, SortedList Prevalues)
 {
     _data      = Data;
     _prevalues = Prevalues;
 }
 public BaseTreePickerEditor(IData Data)
     : base()
 {
     _data = Data;
 }
 public pagePicker(interfaces.IData Data)
 {
     _data = Data;
 }