using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMS.PortalControls;
using CMS.GlobalHelper;
public partial class CMSTestingSite_APIExamples_Controls_DataSourceWebPart : CMSAbstractWebPart
{
/// <summary>
/// Gets or sets WHERE condition.
/// </summary>
public string WhereCondition
{
get
{
return ValidationHelper.GetString(this.GetValue("WhereCondition"), "");
}
set
{
this.SetValue("WhereCondition", value);
srcUsers.WhereCondition = value;
}
}
/// <summary>
/// Gets or sets ORDER BY condition.
/// </summary>
public string OrderBy
{
get
{
return ValidationHelper.GetString(this.GetValue("OrderBy"), "");
}
set
{
this.SetValue("OrderBy", value);
srcUsers.OrderBy = value;
}
}
/// <summary>
/// Gets or sets the source filter name
/// </summary>
public string FilterName
{
get
{
return ValidationHelper.GetString(this.GetValue("FilterName"), "");
}
set
{
this.SetValue("FilterName", value);
srcUsers.SourceFilterName = value;
}
}
/// <summary>
/// Content loaded event handler
/// </summary>
public override void OnContentLoaded()
{
base.OnContentLoaded();
SetupControl();
}
/// <summary>
/// Initializes the control properties
/// </summary>
protected void SetupControl()
{
if (this.StopProcessing)
{
// Do nothing
}
else
{
this.srcUsers.WhereCondition = this.WhereCondition;
this.srcUsers.OrderBy = this.OrderBy;
// Sets the current webpart name as datasource name
this.srcUsers.FilterName = ValidationHelper.GetString(this.GetValue("WebPartControlID"), this.ClientID);
// Sets the name of the extending filter
this.srcUsers.SourceFilterName = this.FilterName;
}
}
}
|