Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["stunum"] != null || Session["adminnum"] != null || Session["thnnum"] != null)
     {
         Session.Abandon();
     }
     DataBaseUtil.connectDB();
 }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["stunum"] == null)
     {
         Response.Write("<script>alert('请先登录!');window.location.href='Login.aspx'</script>");
     }
     else
     {
         DataBaseUtil.connectDB();
     }
 }
Beispiel #3
0
        protected void bind()
        {
            string tnum = Session["thnnum"].ToString();

            DataBaseUtil.connectDB();
            string         showSql = " select tb_student.sno,sname,tb_course.cno,cname,grade from tb_course,tb_sc,tb_teacher,tb_student where tb_course.cno=tb_sc.cno and tb_sc.tno=tb_teacher.tno and tb_sc.sno=tb_student.sno and  tb_sc.tno='" + tnum + "'";
            DataSet        ds      = new DataSet();
            SqlDataAdapter myDA    = new SqlDataAdapter(showSql, myconn);

            myDA.Fill(ds, "TEST");
            GridView1.DataSource = ds;
            GridView1.DataBind();
        }
Beispiel #4
0
        public void dBind()
        {
            DataBaseUtil.connectDB();
            string snum    = Session["stunum"].ToString();
            string showSql = "select sno ,sname ,ssex, sbirth, mname from tb_student join tb_major on tb_student.mno=tb_major.mno and sno='" + snum + "'";

            SqlDataAdapter sda = new SqlDataAdapter(showSql, myconn);
            DataSet        ds  = new DataSet();

            sda.Fill(ds, "stutab");

            GridView1.DataSource = ds;
            GridView1.DataBind();
        }
Beispiel #5
0
        public void dBind()
        {
            DataBaseUtil.connectDB();
            string tnum    = Session["thnnum"].ToString();
            string showSql = "select tno ,dno ,tname, tsex from tb_teacher where tno='" + tnum + "'";

            SqlDataAdapter sda = new SqlDataAdapter(showSql, myconn);
            DataSet        ds  = new DataSet();

            sda.Fill(ds, "thtab");

            GridView1.DataSource = ds;
            GridView1.DataBind();
        }
Beispiel #6
0
        public void dBind()
        {
            DataBaseUtil.connectDB();
            string anum    = Session["adminnum"].ToString();
            string showSql = "select ano ,aname ,apass from tb_admin where ano='" + anum + "'";

            SqlDataAdapter sda = new SqlDataAdapter(showSql, myconn);
            DataSet        ds  = new DataSet();

            sda.Fill(ds, "admintab");

            GridView1.DataSource = ds;
            GridView1.DataBind();
        }
Beispiel #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["adminname"] == null)
     {
         Response.Write("<script>alert('请先登录!');window.location.href='Login.aspx'</script>");
     }
     else if (Session["adminright"].ToString() == "10" || Session["adminright"].ToString() == null)
     {
         Response.Write("<script>alert('您没有权限使用此功能');window.location.href='AdminInfo.aspx'</script>");
     }
     else
     {
         DataBaseUtil.connectDB();
     }
 }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["adminname"] == null)
            {
                Response.Write("<script>alert('请先登录!');window.location.href='Login.aspx'</script>");
            }
            else
            {
                DataBaseUtil.connectDB();
                string ssql = "select mno as '专业编号',mname as '专业名称',tb_major.dno as '系别编号',dname as '系别',dtel as '联系方式' from tb_major join tb_dept on tb_major.dno=tb_dept.dno";

                SqlDataAdapter sda = new SqlDataAdapter(ssql, myconn);
                DataSet        ds  = new DataSet();
                sda.Fill(ds, "mdInfo");
                GridView1.DataSource = ds;
                GridView1.DataBind();
            }
        }
Beispiel #9
0
        protected void bind()
        {
            if (Session["thnnum"] == null)
            {
                Response.Write("<script>alert('请先登录!');window.location.href='Login.aspx'</script>");
            }
            else
            {
                string tnum = Session["thnnum"].ToString();
                DataBaseUtil.connectDB();
                string         showSql = " select cno as '课程号',cname as '课程名',ccredit as '学分',tno as '本人教师编号' from tb_course where tno='" + tnum + "'";
                DataSet        ds      = new DataSet();
                SqlDataAdapter myDA    = new SqlDataAdapter(showSql, myconn);

                myDA.Fill(ds, "TEST");


                GridView1.DataSource = ds;
                GridView1.DataBind();
            }
        }
Beispiel #10
0
        protected void bind()
        {
            if (Session["stunum"] == null)
            {
                Response.Write("<script>alert('请先登录!');window.location.href='Login.aspx'</script>");
            }
            else
            {
                string studentNum = Session["stunum"].ToString();
                DataBaseUtil.connectDB();
                string         showSql = " select tb_course.cno as '课程号',cname as '课程名',ccredit as '学分',tname as '教师名',dname as '系别',dtel as '联系方式' from tb_course,tb_sc,tb_teacher,tb_dept where tb_course.cno=tb_sc.cno and tb_sc.tno=tb_teacher.tno and tb_teacher.dno=tb_dept.dno and tb_sc.sno='" + studentNum + "'";
                DataSet        ds      = new DataSet();
                SqlDataAdapter myDA    = new SqlDataAdapter(showSql, myconn);

                myDA.Fill(ds, "TEST");


                GridView1.DataSource = ds;
                GridView1.DataBind();
            }
        }
Beispiel #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //Label1.Text = Session["stuname"].ToString();//test Session
     DataBaseUtil.connectDB();
 }