using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using CMS.FormControls;
using CMS.GlobalHelper;
using CMS.UIControls;
public partial class CMSModules_OnlineMarketing_FormControls_SelectVariation : FormEngineUserControl
{
#region "Variables"
private string mWhereCondition = String.Empty;
private bool mShowAllVariations = true;
private bool mPostbackOnChange = true;
#endregion
#region "Properties"
///
/// Value representing the control.
///
public override object Value
{
get
{
return ucUniSelector.Value;
}
set
{
ucUniSelector.Value = value;
}
}
///
/// Uniselector control.
///
public UniSelector UniSelector
{
get
{
return ucUniSelector;
}
}
///
/// Where condition for selector.
///
public string WhereCondition
{
get
{
return mWhereCondition;
}
set
{
mWhereCondition = value;
}
}
///
/// If true (all) is added to conversion selector.
///
public bool ShowAllVariations
{
get
{
return mShowAllVariations;
}
set
{
mShowAllVariations = value;
}
}
///
/// If true, full postback is raised when item changed.
///
public bool PostbackOnChange
{
get
{
return mPostbackOnChange;
}
set
{
mPostbackOnChange = value;
}
}
#endregion
#region "Methods"
protected void Page_Load(object sender, EventArgs e)
{
ucUniSelector.AllowEmpty = false;
if (ShowAllVariations)
{
ucUniSelector.AllRecordValue = String.Empty;
ucUniSelector.AllowAll = true;
}
if (PostbackOnChange)
{
ucUniSelector.DropDownSingleSelect.AutoPostBack = true;
ScriptManager scr = ScriptManager.GetCurrent(Page);
scr.RegisterPostBackControl(ucUniSelector.DropDownSingleSelect);
}
if (!URLHelper.IsPostback())
{
ReloadData(false);
}
}
///
/// Reloads data.
///
/// If true data are always loaded
public void ReloadData(bool forceReload)
{
ucUniSelector.WhereCondition = WhereCondition;
ucUniSelector.Reload(forceReload);
}
#endregion
}