예제 #1
0
파일: CustomField.cs 프로젝트: sang-nm/mphc
        /// <summary>
        /// Persists a new instance of CustomField. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            int newID = 0;

            this.guid = Guid.NewGuid();

            newID = DBCustomField.Create(
                this.siteID,
                this.name,
                this.displayName,
                this.dataType,
                this.fieldType,
                this.filterType,
                this.isEnabled,
                this.isRequired,
                this.validationExpression,
                this.invalidMessage,
                this.allowComparing,
                this.displayOrder,
                this.featureGuid,
                this.guid,
                this.options);

            this.customFieldID = newID;

            return(newID > 0);
        }
예제 #2
0
파일: CustomField.cs 프로젝트: sang-nm/mphc
 /// <summary>
 /// Gets an instance of CustomField.
 /// </summary>
 /// <param name="customFieldID"> customFieldID </param>
 private void GetCustomField(
     int customFieldID)
 {
     using (IDataReader reader = DBCustomField.GetOne(
                customFieldID))
     {
         if (reader.Read())
         {
             this.customFieldID        = Convert.ToInt32(reader["CustomFieldID"]);
             this.siteID               = Convert.ToInt32(reader["SiteID"]);
             this.name                 = reader["Name"].ToString();
             this.displayName          = reader["DisplayName"].ToString();
             this.dataType             = Convert.ToInt32(reader["DataType"]);
             this.fieldType            = Convert.ToInt32(reader["FieldType"]);
             this.filterType           = Convert.ToInt32(reader["FilterType"]);
             this.isEnabled            = Convert.ToBoolean(reader["IsEnabled"]);
             this.isRequired           = Convert.ToBoolean(reader["IsRequired"]);
             this.validationExpression = reader["ValidationExpression"].ToString();
             this.invalidMessage       = reader["InvalidMessage"].ToString();
             this.allowComparing       = Convert.ToBoolean(reader["AllowComparing"]);
             this.displayOrder         = Convert.ToInt32(reader["DisplayOrder"]);
             this.featureGuid          = new Guid(reader["FeatureGuid"].ToString());
             this.guid                 = new Guid(reader["Guid"].ToString());
             if (reader["Options"] != DBNull.Value)
             {
                 this.options = Convert.ToInt32(reader["Options"]);
             }
         }
     }
 }
예제 #3
0
파일: CustomField.cs 프로젝트: sang-nm/mphc
        public static List <CustomField> GetActiveByFields(int siteId, Guid featureGuid, List <int> fieldIds, int languageId = -1)
        {
            if (fieldIds.Count > 0)
            {
                return(LoadListFromReader(DBCustomField.GetActiveByFields(siteId, featureGuid, string.Join(";", fieldIds.ToArray()), languageId)));
            }

            return(new List <CustomField>());
        }
예제 #4
0
파일: CustomField.cs 프로젝트: sang-nm/mphc
 private bool Update()
 {
     return(DBCustomField.Update(
                this.customFieldID,
                this.siteID,
                this.name,
                this.displayName,
                this.dataType,
                this.fieldType,
                this.filterType,
                this.isEnabled,
                this.isRequired,
                this.validationExpression,
                this.invalidMessage,
                this.allowComparing,
                this.displayOrder,
                this.featureGuid,
                this.guid,
                this.options));
 }
예제 #5
0
파일: CustomField.cs 프로젝트: sang-nm/mphc
        public static List <CustomField> GetActiveByZone(int siteId, Guid featureGuid, Guid zoneGuid, int languageId = -1)
        {
            IDataReader reader = DBCustomField.GetActiveByZone(siteId, featureGuid, zoneGuid, languageId);

            return(LoadListFromReader(reader));
        }
예제 #6
0
파일: CustomField.cs 프로젝트: sang-nm/mphc
        public static List <CustomField> GetByFeature(int siteId, Guid featureGuid)
        {
            IDataReader reader = DBCustomField.GetByFeature(siteId, featureGuid);

            return(LoadListFromReader(reader));
        }
예제 #7
0
파일: CustomField.cs 프로젝트: sang-nm/mphc
 public static bool Delete(int customFieldID)
 {
     return(DBCustomField.Delete(customFieldID));
 }