using System; using CMS.CMSHelper; using CMS.FormControls; using CMS.GlobalHelper; public partial class CMSModules_Scoring_FormControls_SelectScore : FormEngineUserControl { #region "Variables" int mSiteID; #endregion #region "Properties" /// /// Gets or sets the enabled state of the control. /// public override bool Enabled { get { return uniSelector.Enabled; } set { uniSelector.Enabled = value; } } /// /// Gets or sets field value. /// public override object Value { get { return uniSelector.Value; } set { uniSelector.Value = value; } } /// /// Current site ID. /// public int SiteID { get { if (mSiteID <= 0) { mSiteID = ValidationHelper.GetInteger(GetValue("SiteID"), CMSContext.CurrentSiteID); } return mSiteID; } } #endregion #region "Methods" protected void Page_Load(object sender, EventArgs e) { InitSelector(); } /// /// Initializes uniselector /// private void InitSelector() { uniSelector.WhereCondition = "ScoreEnabled = 1 AND ScoreSiteID = " + SiteID; uniSelector.AllowAll = ValidationHelper.GetBoolean(GetValue("AllowAll"), uniSelector.AllowAll); uniSelector.AllowEmpty = ValidationHelper.GetBoolean(GetValue("AllowEmpty"), uniSelector.AllowEmpty); uniSelector.Reload(true); } #endregion }