Пример #1
0
    public static bool IsVisible(EmailTemplateEntity et, EmailTemplateVisibleOn visibleOn)
    {
        if (et.Model == null)
        {
            return(visibleOn == EmailTemplateVisibleOn.Single);
        }

        if (EmailModelLogic.HasDefaultTemplateConstructor(et.Model))
        {
            return(false);
        }

        var entityType = EmailModelLogic.GetEntityType(et.Model.ToType());

        if (entityType.IsEntity())
        {
            return(visibleOn == EmailTemplateVisibleOn.Single);
        }

        var should = VisibleOnDictionary.TryGet(entityType, EmailTemplateVisibleOn.Single);

        return((should & visibleOn) != 0);
    }
Пример #2
0
        public string GetConstructorType([Required, FromBody] EmailModelEntity model)
        {
            var type = EmailModelLogic.GetEntityType(model.ToType());

            return(ReflectionServer.GetTypeName(type));
        }