コード例 #1
0
 private bool Update()
 {
     return(DBCustomFieldOption.Update(
                this.customFieldOptionID,
                this.customFieldID,
                this.name,
                this.optionType,
                this.optionColor,
                this.fromValue,
                this.toValue,
                this.displayOrder,
                this.guid));
 }
コード例 #2
0
        private bool Create()
        {
            int newID = 0;

            this.guid = Guid.NewGuid();

            newID = DBCustomFieldOption.Create(
                this.customFieldID,
                this.name,
                this.optionType,
                this.optionColor,
                this.fromValue,
                this.toValue,
                this.displayOrder,
                this.guid);

            this.customFieldOptionID = newID;

            return(newID > 0);
        }
コード例 #3
0
 private void GetCustomFieldOption(
     int customFieldOptionID)
 {
     using (IDataReader reader = DBCustomFieldOption.GetOne(
                customFieldOptionID))
     {
         if (reader.Read())
         {
             this.customFieldOptionID = Convert.ToInt32(reader["CustomFieldOptionID"]);
             this.customFieldID       = Convert.ToInt32(reader["CustomFieldID"]);
             this.name         = reader["Name"].ToString();
             this.optionType   = Convert.ToInt32(reader["OptionType"]);
             this.optionColor  = reader["OptionColor"].ToString();
             this.fromValue    = Convert.ToDecimal(reader["FromValue"]);
             this.toValue      = Convert.ToDecimal(reader["ToValue"]);
             this.displayOrder = Convert.ToInt32(reader["DisplayOrder"]);
             this.guid         = new Guid(reader["Guid"].ToString());
         }
     }
 }
コード例 #4
0
        /// <summary>
        /// gets the next sort rank
        /// </summary>
        /// <param name="customFieldId"></param>
        /// <returns>int</returns>
        public static int GetMaxSortOrder(int customFieldId)
        {
            int nextSort = DBCustomFieldOption.GetMaxSortOrder(customFieldId) + 2;

            return(nextSort);
        }
コード例 #5
0
        public static List <CustomFieldOption> GetByOptionIds(int siteId, string optionIds, int languageId = -1)
        {
            IDataReader reader = DBCustomFieldOption.GetByOptionIds(siteId, optionIds, languageId);

            return(LoadListFromReader(reader, true));
        }
コード例 #6
0
        public static List <CustomFieldOption> GetByCustomField(int customFieldId, int languageId)
        {
            IDataReader reader = DBCustomFieldOption.GetByCustomField(customFieldId, languageId);

            return(LoadListFromReader(reader, false));
        }
コード例 #7
0
 public static bool DeleteCustomField(int customFieldID)
 {
     return(DBCustomFieldOption.DeleteCustomField(customFieldID));
 }