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

namespace JuSNS.Web.inc.Ajax.bill
{
    public partial class classlist : JuSNS.UI.Page.UserPage
    {
        JuSNS.Home.Bill bll = new JuSNS.Home.Bill();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["a"] == "del")
            {
                if (bll.DelClassInfo(UserID, Convert.ToInt32(Request.QueryString["id"])) > 0)
                {
                    Response.Redirect("classlist.aspx");
                }
            }
            else
            {
                string list = string.Empty;
                IDataReader dr = bll.GetClassList(UserID);
                while (dr.Read())
                {
                    list += "<div class=\"nl w280\" style=\"padding-left:15px;\"><div class=\"nl w200\">" + dr["className"].ToString() + "</div><div class=\"nr\"><span class=\"delete1\"><a href=\"classlist.aspx?a=del&id=" + dr["id"].ToString() + "\"  onclick=\"{if(confirm('确定要删除吗？')){return true;}return false;}\">删除</a></span></div></div>";
                    list += "<div class=\"line-none\"></div>";
                }
                dr.Close();
                this.classList.InnerHtml = list;
            }
        }
    }
}
