必须填写至少10个字的日志
nnhy authored at 2012-07-27 18:48:21
1.49 KiB
X
/*
 * XCoder v4.5.2011.1108
 * 作者:nnhy/NEWLIFE
 * 时间:2011-11-14 17:39:37
 * 版权:版权所有 (C) 新生命开发团队 2011
*/
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NewLife.CommonEntity;
using NewLife.Web;

public partial class Common_TemplateItem : MyEntityList
{
    /// <summary>实体类型</summary>
    public override Type EntityType { get { return typeof(TemplateItem); } set { base.EntityType = value; } }

    /// <summary>模版编号</summary>
    public Int32 TemplateID { get { return WebHelper.RequestInt("TemplateID"); } }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (TemplateID > 0)
            {
                Template entity = Template.FindByID(TemplateID);
                if (entity == null)
                    WebHelper.AlertAndEnd("非法参数!");
                else
                {
                    lbAdd.Url += "?TemplateID=" + TemplateID;

                    lnkReturn.Text = lnkReturn.ToolTip = String.Format("返回模版管理【{0}】", entity.Name);
                    lnkReturn.Visible = true;
                }
            }
            else
                lbAdd.Visible = false;
        }
    }

    protected void ods_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {
        e.InputParameters["templateid"] = TemplateID;
    }
}