62,075
社区成员
发帖
与我相关
我的任务
分享
using ...
using ComLib;
/// <summary>
/// ExportPage 的摘要说明
/// </summary>
public class ExportPage<T>:Page where T:new()
{
protected TextBox txtCaseNo;
protected override void OnLoad(EventArgs e)
{
txtCaseNo = (TextBox)this.MasterP.FindControl("CPH").FindControl("txtCaseNo");
if (!export(CommOp.ToStr(Request.QueryString["CaseNo"])))
txtCaseNo.Focus();
}
protected bool export(String caseNo)
{
if (caseNo == String.Empty) return false;
IExport er = (IExport)new T();
er.CaseNo = caseNo;
er.ExportToExcel();
return true;
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
if (!export(MyWeb.GetUpperText(txtCaseNo)))
txtCaseNo.Focus();
}
}
using ....
using ComLib;
namespace FWeb.FReceive
{
public partial class PreReceiveRpt : ExportPage<ExportPreReceive> { }
}
protected bool export(String caseNo)
{
if (caseNo == String.Empty) return false;
IExportToExcel toExcel = ((IPage01)this.Page).GetToExcelClass(caseNo);
toExcel.ExportToExcel()
return true;
}