Пример #1
0
 /// <summary>
 /// Gets the value of one of this object's properties.
 /// </summary>
 public virtual object GetValue(Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants field, object defaultValue)
 {
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants.Name)
     {
         return(this.Name);
     }
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants.ProjectTypeId)
     {
         return(this.ProjectTypeId);
     }
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants.CreatedBy)
     {
         return((this.CreatedBy == null) ? defaultValue : this.CreatedBy);
     }
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants.CreatedDate)
     {
         return((this.CreatedDate == null) ? defaultValue : this.CreatedDate);
     }
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants.ModifiedBy)
     {
         return((this.ModifiedBy == null) ? defaultValue : this.ModifiedBy);
     }
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants.ModifiedDate)
     {
         return((this.ModifiedDate == null) ? defaultValue : this.ModifiedDate);
     }
     throw new Exception("Field '" + field.ToString() + "' not found!");
 }
Пример #2
0
        /// <summary>
        /// Gets the maximum size of the field value.
        /// </summary>
        public static int GetMaxLength(Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants field)
        {
            switch (field)
            {
            case Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants.Name:
                return(50);

            case Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants.ProjectTypeId:
                return(0);                        //Type=Int
            }
            return(0);
        }
Пример #3
0
        /// <summary>
        /// Gets the system type of a field on this object
        /// </summary>
        public static System.Type GetFieldType(Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants field)
        {
            if (field.GetType() != typeof(Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants))
            {
                throw new Exception("The field parameter must be of type 'Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants'.");
            }

            switch ((Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants)field)
            {
            case Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants.Name: return(typeof(string));

            case Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants.ProjectTypeId: return(typeof(int));
            }
            return(null);
        }
Пример #4
0
 /// <summary>
 /// Returns the actual database name of the specified field.
 /// </summary>
 internal static string GetDatabaseFieldName(Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants field)
 {
     return(GetDatabaseFieldName(field.ToString()));
 }
Пример #5
0
 /// <summary>
 /// Gets the value of one of this object's properties.
 /// </summary>
 public virtual object GetValue(Acme.MultiTenant.EFDAL.Entity.ProjectType.FieldNameConstants field)
 {
     return(GetValue(field, null));
 }