Пример #1
0
 /// <summary>
 /// Gets the value of one of this object's properties.
 /// </summary>
 public virtual object GetValue(Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants field, object defaultValue)
 {
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants.FileName)
     {
         return(this.FileName);
     }
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants.ProjectFileId)
     {
         return(this.ProjectFileId);
     }
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants.ProjectId)
     {
         return(this.ProjectId);
     }
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants.CreatedBy)
     {
         return((this.CreatedBy == null) ? defaultValue : this.CreatedBy);
     }
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants.CreatedDate)
     {
         return((this.CreatedDate == null) ? defaultValue : this.CreatedDate);
     }
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants.ModifiedBy)
     {
         return((this.ModifiedBy == null) ? defaultValue : this.ModifiedBy);
     }
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants.ModifiedDate)
     {
         return((this.ModifiedDate == null) ? defaultValue : this.ModifiedDate);
     }
     throw new Exception("Field '" + field.ToString() + "' not found!");
 }
Пример #2
0
 /// <summary>
 /// Assigns a value to a field on this object.
 /// </summary>
 /// <param name="field">The field to set</param>
 /// <param name="newValue">The new value to assign to the field</param>
 /// <param name="fixLength">Determines if the length should be truncated if too long. When false, an error will be raised if data is too large to be assigned to the field.</param>
 public virtual void SetValue(Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants field, object newValue, bool fixLength)
 {
     if (field == Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants.FileName)
     {
         this.FileName = GlobalValues.SetValueHelperInternal((string)newValue, fixLength, GetMaxLength(field));
     }
     else if (field == Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants.ProjectFileId)
     {
         throw new Exception("Field '" + field.ToString() + "' is a primary key and cannot be set!");
     }
     else if (field == Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants.ProjectId)
     {
         this.ProjectId = GlobalValues.SetValueHelperIntNotNullableInternal(newValue, "Field 'ProjectId' does not allow null values!");
     }
     else
     {
         throw new Exception("Field '" + field.ToString() + "' not found!");
     }
 }
Пример #3
0
 /// <summary>
 /// Returns the actual database name of the specified field.
 /// </summary>
 internal static string GetDatabaseFieldName(Acme.MultiTenant.EFDAL.Entity.ProjectFile.FieldNameConstants field)
 {
     return(GetDatabaseFieldName(field.ToString()));
 }