private bool Update() { return(DBCustomFieldOption.Update( this.customFieldOptionID, this.customFieldID, this.name, this.optionType, this.optionColor, this.fromValue, this.toValue, this.displayOrder, this.guid)); }
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); }
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()); } } }
/// <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); }
public static List <CustomFieldOption> GetByOptionIds(int siteId, string optionIds, int languageId = -1) { IDataReader reader = DBCustomFieldOption.GetByOptionIds(siteId, optionIds, languageId); return(LoadListFromReader(reader, true)); }
public static List <CustomFieldOption> GetByCustomField(int customFieldId, int languageId) { IDataReader reader = DBCustomFieldOption.GetByCustomField(customFieldId, languageId); return(LoadListFromReader(reader, false)); }
public static bool DeleteCustomField(int customFieldID) { return(DBCustomFieldOption.DeleteCustomField(customFieldID)); }