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.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace WebApplication1
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        public string[] s;
        protected void Page_Load(object sender, EventArgs e)
        {
            string indt;
            indt = Request.Params["index"];
            s = indt.Split(' ');
            if (s[1].ToString() == "已开会议")
            {
                rdb_id1.Enabled = false;
            }
            BLL.T_Meeting meet = new BLL.T_Meeting();
            string strwhe = "m_autoID= '" + s[0] + " '";
            DataTable dt = meet.select(strwhe);
            if (dt.Rows[0][9].ToString() == "False" || dt.Rows[0][9].ToString() == "false")
            {
                rdb_id1.Checked = true;
            }
            else
            {
                rdb_id2.Checked = true;
            }
            Repeater1.DataSource = dt;
            Repeater1.DataBind();
        }

        protected void btn1_Click(object sender, EventArgs e)
        {
            if (rdb_id2.Checked == true)
            {
                BLL.T_Meeting meet = new BLL.T_Meeting();
                Models.T_Meeting mod = new Models.T_Meeting();
                mod.m_statemeeting = true;
                meet.update(mod, int.Parse(s[0].ToString()));
                if (s[1].ToString() == "已开会议")
                {
                    Response.Redirect("Meeted.aspx");
                }
                else
                {
                    Response.Redirect("Meeting.aspx");
                }
            }
            else
            {
                BLL.T_Meeting meet = new BLL.T_Meeting();
                Models.T_Meeting mod = new Models.T_Meeting();
                mod.m_statemeeting = false;
                meet.update(mod, int.Parse(s[0].ToString()));
                if (s[1].ToString() == "已开会议")
                {
                    Response.Redirect("Meeted.aspx");
                }
                else
                {
                    Response.Redirect("Meeting.aspx");
                }
            }
        }
    }
}
