using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CMS.GlobalHelper;
using CMS.PortalControls;
using CMS.UIControls;
public partial class CMSWebParts_ProjectManagement_ProjectList : CMSAbstractWebPart
{
#region "Variables"
private bool displayErrorMessage = false;
#endregion
#region "Properties"
///
/// Gets or sets the permission for creating new project.
///
public string ProjectAccess
{
get
{
return ValidationHelper.GetString(GetValue("ProjectAccess"), ucProjectList.ProjectAccess);
}
set
{
SetValue("ProjectAccess", value);
ucProjectList.ProjectAccess = value;
}
}
///
/// Gest or sets the role names separated by semicolon which are authorized to create new project.
///
public string AuthorizedRoles
{
get
{
return ValidationHelper.GetString(GetValue("AuthorizedRoles"), ucProjectList.AuthorizedRoles);
}
set
{
SetValue("AuthorizedRoles", value);
ucProjectList.AuthorizedRoles = value;
}
}
///
/// Show finished projects too.
///
public bool ShowFinishedProjects
{
get
{
return ValidationHelper.GetBoolean(GetValue("ShowFinishedProjects"), ucProjectList.ShowFinishedProjects);
}
set
{
SetValue("ShowFinishedProjects", value);
ucProjectList.ShowFinishedProjects = value;
}
}
///
/// If true records are paged.
///
public bool EnablePaging
{
get
{
return ValidationHelper.GetBoolean(GetValue("EnablePaging"), ucProjectList.EnablePaging);
}
set
{
SetValue("EnablePaging", value);
ucProjectList.EnablePaging = value;
}
}
///
/// Number of items per page.
///
public int PageSize
{
get
{
return ValidationHelper.GetInteger(GetValue("PageSize"), ucProjectList.PageSize);
}
set
{
SetValue("PageSize", value);
ucProjectList.PageSize = value;
}
}
#endregion
#region "Methods"
///
/// Content loaded event handler.
///
public override void OnContentLoaded()
{
base.OnContentLoaded();
SetupControl();
}
///
/// Setup control.
///
protected void SetupControl()
{
// Do nothing if stop processing is enabled
if (StopProcessing)
{
Visible = false;
return;
}
ucProjectList.DisplayMode = ControlDisplayModeEnum.Simple;
ucProjectList.ShowFinishedProjects = ShowFinishedProjects;
ucProjectList.EnablePaging = EnablePaging;
ucProjectList.PageSize = PageSize;
ucProjectList.IsLiveSite = true;
ucProjectList.ProjectAccess = ProjectAccess;
ucProjectList.AuthorizedRoles = AuthorizedRoles;
}
///
/// Reloads the control data.
///
public override void ReloadData()
{
base.ReloadData();
SetupControl();
}
///
/// Render override.
///
/// Writer
protected override void Render(HtmlTextWriter writer)
{
if (!displayErrorMessage)
{
messageElem.Visible = false;
}
base.Render(writer);
}
#endregion
}