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.Common;
using TopWinCMS.BLL;
namespace TopWinCMS.WebUI.Admin.Vote
{
    public partial class Vote : System.Web.UI.Page
    {
        SQLModel s_model = new SQLModel();
        //BLL_Index_Vote MyClassBLL = new BLL_Index_Vote();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RightsCheck.CheckWorkPower("P_3");
                BindList();
            }
        }
        public void BindList()
        {
             
            s_model.PageSize = 10; 
           
            new VoteManage().BindList(GV_List, this.PageNavigation1, s_model);
        }
        protected void BT_Delete_Click(object sender, EventArgs e)
        {
            string IDs = GetSelectedRow.IDs(GV_List);

            new VoteManage().Delete(IDs);

            BindList();
        }

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

        protected void GV_List_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }
            TableCell tc = e.Row.Cells[5];
            if (tc.Text == "1")
            {
                tc.Text = "单选";
            }
            else
            {
                tc.Text = "多选";
            }
        }
    }
}
