using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
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 System.Xml.Linq;

namespace WebApplication1
{
    public partial class Meeteed : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            string pre = "已开会议";
            int a = 0;
            string index = "";
            foreach (GridViewRow gvr in this.GridView1.Rows)
            {
                Control ctl = gvr.FindControl("chk_id1");
                CheckBox ck = (CheckBox)ctl;
                if (ck.Checked)
                {
                    TableCellCollection cell = gvr.Cells;
                    index = cell[0].Text;
                    a += 1;
                }
            }
            if (a > 1)
            {
                Response.Write("<script>alert('请选择一条会议进行查看！')</script>");
            }
            else
            {
                Response.Redirect("Meet.aspx?index=" + index + " " + pre);
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow gvr in this.GridView1.Rows)
            {
                Control ctl = gvr.FindControl("chk_id2");
                CheckBox ck = (CheckBox)ctl;
                if (ck.Checked)
                {
                    TableCellCollection cell = gvr.Cells;
                    BLL.T_Meeting me = new BLL.T_Meeting();
                    if (me.delete(cell[0].Text))
                    {
                        Response.Write("<script>alert('删除成功！')</script>");
                    }
                    else
                    {
                        Response.Write("<script>alert('删除失败！')</script>");
                    }
                    Response.Redirect("Meeted.aspx");
                }
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("main.aspx");
        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void GridView1_RowDeleted(object sender, GridViewDeletedEventArgs e)
        {

        }

        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {

        }
    }
}
