/// <summary> /// Primary constructor. /// </summary> /// <param name="persistence"> /// The entity persistence. /// </param> /// <param name="tree"> /// The tree controller. /// </param> /// <param name="helper"> /// The folder helper. /// </param> public FormHelper(IEntityPersistence persistence, TreeController tree, FolderHelper helper) { Persistence = persistence; Tree = tree; Helper = helper; }
public EntityWebEventArgs(IListDeleteRegister entityManager, IEntityPersistence entity, string pageName) : this(entityManager, entity, pageName, null) { }
private bool isCorrectTypeEntity(IEntityPersistence entity) { return(entitySource == entity.GetType().Name); }
/// <summary> /// Default constructor. /// </summary> public EntitiesController(IEntityPersistence entityPersistence, IEntityHelper entityHelper) { Entities = entityPersistence; EntityHelper = entityHelper; }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public ValidationsController(UmbracoContext context) : base(context) { Persistence = ValidationPersistence.Current.Manager; Entities = EntityPersistence.Current.Manager; }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public FoldersController(UmbracoContext context) : base(context) { Persistence = FolderPersistence.Current.Manager; Entities = EntityPersistence.Current.Manager; }
/// <summary> /// Primary constructor. /// </summary> /// <param name="persistence"> /// The entity persistence. /// </param> /// <param name="tree"> /// The tree controller. /// </param> public FolderHelper(IEntityPersistence persistence, TreeController tree) { Persistence = persistence; Tree = tree; }
public void SetValuePropertyEntity(IEntityPersistence entity, string propertyName, object value) { if (propertyName == string.Empty) { return; } PropertyInfo propertyInfo = GetPropertyInfo(entity, propertyName); if (propertyInfo == null) { return; } Type typeProperty = propertyInfo.PropertyType; if (typeProperty.Name.ToLower() == "nullable`1" && value != null) { if (value.ToString().Trim() != string.Empty) { typeProperty = Nullable.GetUnderlyingType(typeProperty); } else { value = null; } } try { switch (typeProperty.Name.ToLower()) { case "string": propertyInfo.SetValue(entity, (value != null ? value.ToString() : string.Empty), null); break; case "int16": case "int32": case "int64": propertyInfo.SetValue(entity, Convert.ToInt32(value), null); break; case "boolean": propertyInfo.SetValue(entity, Convert.ToBoolean(value), null); break; case "datetime": propertyInfo.SetValue(entity, Convert.ToDateTime(value), null); break; case "decimal": propertyInfo.SetValue(entity, Convert.ToDecimal(value), null); break; default: propertyInfo.SetValue(entity, value, null); break; } } catch (TargetInvocationException E) { if (E.InnerException is PropertyException) { throw new PropertyException(((PropertyException)E.InnerException).Property, E.InnerException.Message); } } catch (PropertyException E) { throw new PropertyException(E.Message); } catch (FormatException E) { string displayProperty = string.Empty; DisplayNamePropertyAttribute attributo = GetAttribute(propertyInfo, typeof(DisplayNamePropertyAttribute)) as DisplayNamePropertyAttribute; if (attributo != null) { displayProperty = attributo.DisplayName; } else { displayProperty = propertyInfo.Name; } throw new PropertyException(new Property(propertyInfo.Name, value), "O campo " + displayProperty + " está com valor inválido !", E); } }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public FoldersController(UmbracoContext context) : base(context) { Persistence = FolderPersistence.Current.Manager; Entities = EntityPersistence.Current.Manager; }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public DataValuesController(IDataValuePersistence dataValuePersistence, IEntityPersistence entityPersistence, DataValueKindCollection dataValueKindCollection) { Persistence = dataValuePersistence; Entities = entityPersistence; DataValueKindCollection = dataValueKindCollection; }
public EntityRepository(IConfigurationSettings configuration, IEntityPersistence <T> persistence, IPasswordManagement passwordManagement) { _configuration = configuration; _persistence = persistence; _passwordManagement = passwordManagement; }
public EntityWebEventArgs(IListDeleteRegister entityManager, IEntityPersistence entity, IList listSource) : base(entityManager, entity, listSource) { }
public EntityWebEventArgs(IListDeleteRegister entityManager, IEntityPersistence entity) : base(entityManager, entity) { }
public static void Execute(IEntityPersistence entity, IComponent parent) { Execute(entity, parent, true); }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public LayoutsController(UmbracoContext context) : base(context) { Persistence = LayoutPersistence.Current.Manager; Entities = EntityPersistence.Current.Manager; }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public ValidationsController(UmbracoContext context) : base(context) { Persistence = ValidationPersistence.Current.Manager; Entities = EntityPersistence.Current.Manager; }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public ConfiguredFormsController(UmbracoContext context) : base(context) { Persistence = ConfiguredFormPersistence.Current.Manager; Entities = EntityPersistence.Current.Manager; }
/// <summary> /// Primary constructor. /// </summary> /// <param name="entityPersistence"> /// The entity Persistence. /// </param> /// <param name="validationPersistence"> /// The validation Persistence. /// </param> public ValidationsController(IEntityPersistence entityPersistence, IValidationPersistence validationPersistence) { Persistence = validationPersistence; Entities = entityPersistence; }
public static IEnumerable <T> GetByIds <T>(this IEntityPersistence service, IEnumerable <long> ids) where T : Entity { return(service.GetByIds <T>(ids)); }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public ConfiguredFormsController(IConfiguredFormPersistence configuredFormPersistence, IEntityPersistence entityPersistence) { Persistence = configuredFormPersistence; Entities = entityPersistence; }
public static IEnumerable <T> GetByIds <T>(this IEntityPersistence service, IEnumerable <int> ids) where T : Entity { return(service.GetByIds <T>(ids.ToInt64s())); }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public CloudController(UmbracoContext context) : base(context) { Entities = EntityPersistence.Current.Manager; }
public static PagedDataResult <T> GetByIdsPaged <T>(this IEntityPersistence service, IEnumerable <long> ids, IPagedDataRequestSource source) where T : Entity { //var asObjects = CastIds(set); return(service.GetByIdsPaged <T>(ids, source)); }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public LayoutsController(UmbracoContext context) : base(context) { Persistence = LayoutPersistence.Current.Manager; Entities = EntityPersistence.Current.Manager; }
public static PagedDataResult <T> GetByIdsPaged <T>(this IEntityPersistence service, IEnumerable <int> ids, IPagedDataRequestSource source) where T : Entity { return(service.GetByIdsPaged <T>(ids.ToInt64s(), source)); }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public DataValuesController(UmbracoContext context) : base(context) { Persistence = DataValuePersistence.Current.Manager; Entities = EntityPersistence.Current.Manager; }
/// <summary> /// Primary constructor. /// </summary> /// <param name="context">Umbraco context.</param> public EntitiesController(UmbracoContext context) : base(context) { Entities = EntityPersistence.Current.Manager; }
/// <summary> /// Primary constructor. /// </summary> /// <param name="persistence"> /// The entity persistence. /// </param> /// <param name="tree"> /// The tree controller. /// </param> public FolderHelper(IEntityPersistence persistence, TreeController tree) { Persistence = persistence; Tree = tree; }
public virtual void SetDataSource(IEntityPersistence entity) { }