/// <summary>
 /// 初始化添加/编辑表单
 /// </summary>
 public void Initialize()
 {
     try
     {
         ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage  singlePage       = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.SinglePageModule.NHibernateDAL.SinglePage)) as ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage;
         ZhuJi.Modules.SinglePageModule.Domain.SinglePage domainSinglePage = singlePage.GetObjectByChannelId(_identity);
         if (domainSinglePage != null)
         {
             UIMapping.BindObjectToControls(domainSinglePage, this);
             UIMapping.BindObjectToControls(domainSinglePage.ContentBaseInfo, this);
             ContentBaseId.Text = domainSinglePage.ContentBaseInfo.Id.ToString();
             Id.Text            = domainSinglePage.Id.ToString();
             btnAdd.Visible     = false;
             btnEdit.Visible    = true;
             btnDel.Visible     = true;
         }
         else
         {
             btnAdd.Visible     = true;
             btnEdit.Visible    = false;
             btnDel.Visible     = false;
             ChannelId.Text     = _identity.ToString();
             CreatedByIp.Text   = GlobalHelper.IP;
             CreatedByUser.Text = GlobalHelper.User;
             CreatedByDate.Text = GlobalHelper.Time.ToString();
         }
     }
     catch (Exception ex)
     {
         ShowMessage(ex);
     }
 }
 /// <summary>
 /// 初始化表单
 /// </summary>
 public void Initialize()
 {
     try
     {
         ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage  singlePage       = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.SinglePageModule.NHibernateDAL.SinglePage)) as ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage;
         ZhuJi.Modules.SinglePageModule.Domain.SinglePage domainSinglePage = singlePage.GetObjectByChannelId(_identity);
         if (domainSinglePage != null)
         {
             UIMapping.BindObjectToControls(domainSinglePage, this);
             UIMapping.BindObjectToControls(domainSinglePage.ContentBaseInfo, this);
         }
     }
     catch (Exception ex)
     {
         ShowMessage(ex);
     }
 }
        /// <summary>
        /// 点击删除按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDel_Click(object sender, EventArgs e)
        {
            try
            {
                ZhuJi.Modules.SinglePageModule.Domain.SinglePage domainSinglePage  = new ZhuJi.Modules.SinglePageModule.Domain.SinglePage();
                ZhuJi.Modules.Core.Domain.ContentBase            domainContentBase = new ZhuJi.Modules.Core.Domain.ContentBase();
                domainContentBase.Id             = int.Parse(ContentBaseId.Text.Trim());
                domainSinglePage.Id              = int.Parse(Id.Text);
                domainSinglePage.ContentBaseInfo = domainContentBase;

                ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage singlePage = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.SinglePageModule.NHibernateDAL.SinglePage)) as ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage;

                singlePage.Delete(domainSinglePage);
            }
            catch (Exception ex)
            {
                ShowMessage(ex);
            }
            Response.Redirect(Request.Url.ToString(), true);
        }
        /// <summary>
        /// 点击添加按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    ZhuJi.Modules.SinglePageModule.Domain.SinglePage domainSinglePage  = new ZhuJi.Modules.SinglePageModule.Domain.SinglePage();
                    ZhuJi.Modules.Core.Domain.ContentBase            domainContentBase = new ZhuJi.Modules.Core.Domain.ContentBase();
                    UIMapping.BindControlsToObject(domainSinglePage, this);
                    UIMapping.BindControlsToObject(domainContentBase, this);
                    domainSinglePage.ContentBaseInfo = domainContentBase;

                    ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage singlePage = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.SinglePageModule.NHibernateDAL.SinglePage)) as ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage;

                    singlePage.Insert(domainSinglePage);
                }
                catch (Exception ex)
                {
                    ShowMessage(ex);
                }
                Response.Redirect(Request.Url.ToString(), true);
            }
        }
        /// <summary>
        /// 点击添加按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                try
                {
                    ZhuJi.Modules.SinglePageModule.Domain.SinglePage domainSinglePage = new ZhuJi.Modules.SinglePageModule.Domain.SinglePage();
                    ZhuJi.Modules.Core.Domain.ContentBase domainContentBase = new ZhuJi.Modules.Core.Domain.ContentBase();
                    UIMapping.BindControlsToObject(domainSinglePage, this);
                    UIMapping.BindControlsToObject(domainContentBase, this);
                    domainSinglePage.ContentBaseInfo = domainContentBase;

                    ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage singlePage = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.SinglePageModule.NHibernateDAL.SinglePage)) as ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage;

                    singlePage.Insert(domainSinglePage);
                }
                catch (Exception ex)
                {
                    ShowMessage(ex);
                }
                Response.Redirect(Request.Url.ToString(), true);
            }
        }
        /// <summary>
        /// 点击删除按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDel_Click(object sender, EventArgs e)
        {
            try
            {
                ZhuJi.Modules.SinglePageModule.Domain.SinglePage domainSinglePage = new ZhuJi.Modules.SinglePageModule.Domain.SinglePage();
                ZhuJi.Modules.Core.Domain.ContentBase domainContentBase = new ZhuJi.Modules.Core.Domain.ContentBase();
                domainContentBase.Id = int.Parse(ContentBaseId.Text.Trim());
                domainSinglePage.Id = int.Parse(Id.Text);
                domainSinglePage.ContentBaseInfo = domainContentBase;

                ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage singlePage = ZhuJi.AOP.Operator.WrapInterface(typeof(ZhuJi.Modules.SinglePageModule.NHibernateDAL.SinglePage)) as ZhuJi.Modules.SinglePageModule.IDAL.ISinglePage;

                singlePage.Delete(domainSinglePage);
            }
            catch (Exception ex)
            {
                ShowMessage(ex);
            }
            Response.Redirect(Request.Url.ToString(), true);
        }