You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

63 lines
1.8 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Forks.EnterpriseServices.DataForm;
using TSingSoft.WebControls2;
namespace BWP.Web
{
public abstract class DFGridReportPage<T> : DFGridReportPage
{
protected DFInfo mDFInfo = DFInfo.Get(typeof(T));
protected override void InitForm(System.Web.UI.HtmlControls.HtmlForm form)
{
if (fromSuperScreen)
{
mQueryContainer = QueryContainer.FromResource(BasisType.FullName + ".xml", BasisType.Assembly);
mQueryControls.QueryContainer = mQueryContainer;
var queryContainerScript = new QueryContainerScript(mQueryContainer) { ID = "QueryContainer" };
form.Controls.Add(queryContainerScript);
var vPanel = form.EAdd(new VLayoutPanel());
AddResultControls(vPanel);
if (!string.IsNullOrEmpty(ResultHeightClientExpression))
{
vPanel.PreRender += (sender, e) =>
{
var script = "$(function(){$('#{ClientID}').css('max-height',({ResultHeightClientExpression})+'px');});"
.Replace("{ClientID}", vPanel.ClientID)
.Replace("{ResultHeightClientExpression}", ResultHeightClientExpression);
vPanel.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ResultHeightClientExpression", script, true);
};
}
}
else
base.InitForm(form);
mDFGrid.HeaderPagerLock = true;
mDFGrid.AllowColGroup = true;
mDFGrid.AllowSorting = true;
}
protected bool fromSuperScreen
{
get { return !string.IsNullOrEmpty(Request.QueryString["type"]); }
}
protected override bool EnableExcelExport
{
get
{
return !fromSuperScreen;
}
}
protected override bool EnablePrint
{
get
{
return !fromSuperScreen;
}
}
}
}