using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using TopWinCMS.BLL;
using TopWinCMS.Common;
namespace TopWinCMS.WebUI.Admin.Common
{
    public partial class TopWinCMS_DiggManage : System.Web.UI.Page
    {
        SQLModel s_model = new SQLModel();
        /// <summary>
        /// 模型ID
        /// </summary>
        protected int ModelID;
        string _strContentName;

        protected void Page_Load(object sender, EventArgs e)
        {
            ModelID = int.Parse(Request["ModelID"]);
          
            _strContentName = ModelManage.GetContentName(ModelID);


            if (!IsPostBack)
            {
                RightsCheck.CheckWorkRight("OP", true);

                string strPath = string.Format("{0} → <a href='TopWinCMS_DiggManage.aspx?ModelID={1}'>Digg 管理</a>",
                ModelManage.GetModelName(ModelID),
                ModelID
              );
                LB_Path.Text = strPath;

                BindList();
            }
        }


        public void BindList()
        {

            GV_List.EmptyDataTemplate = TopWinCMS.WebFactory.PageBase.GetTemplate(this);
            s_model.TableName = "VW_" + ModelManage.GetTableName(ModelID) + "_Digg";//查询的表或者视图
            
            s_model.PageSize = 10;

            new TopWinCMS.BLL.DiggManage().BindList(GV_List, this.PageNavigation1, s_model);
        }

        protected void PageNavigation1_PageChanging(object src, TopWinCMS.WebControls.PageChangingEventArgs e)
        {
            s_model.PageNo = e.NewPageIndex;
            BindList();
        }

        protected void DelSeletedID_Click(object sender, EventArgs e)
        {
            new DiggDiaryManage().Delete(GetSelectedRow.IDs(this.GV_List));
        }

       

    }
}