• 大小: 563KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2022-06-24
  • 语言: C#
  • 标签: asp.net  c#  

资源简介

自己做的一个网上选课系统,包括前台学生老师界面,后台管理员界面。前台登陆用户名为学生学号,老师的编号。密码和学生学号、老师编号一样,进入后自行修改。有问题可以联系我 qq65946750

资源截图

代码片段和文件信息

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;
using System.Data.SqlClient;
using 网上选课.DataAcesslayer;

namespace 网上选课
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender EventArgs e)
        {

        }

        protected void Button1_Click(object sender EventArgs e)
        {
            int TypeNum = Convert.ToInt32(typeDropDownList.SelectedValue);
            string SelStr = ““;
            Database db = new Database();
            switch (TypeNum)
            {
                case 1:
                    SelStr = “select * from tb_student where stuid=@stuid and stupwd=@stupwd“;
                    SqlConnection con = db.CreateCon();
                    con.Open();
                    SqlCommand cmd = new SqlCommand(SelStrcon);
                    cmd.Parameters.AddWithValue(“@stuid“this.usernameTextBox.Text);
                    cmd.Parameters.AddWithValue(“stupwd“this.userpwdTextBox.Text);
                    SqlDataReader sdr = cmd.ExecuteReader();
                    if (sdr.Read())
                    {
                        Session[“type“] = 1;
                        Session[“username“] = this.usernameTextBox.Text;
                        Response.Redirect(“~/Web/StudentSelectCource.aspx“);
                    }
                    else
                    {
                        Response.Write(“ript>alert(‘error‘);history.back()ript>“);
                    }
                    break;
                case 2:
                    SelStr = “select * from tb_teacher where teaid=@teaid and teapwd=@teapwd“;
                    SqlConnection con1 = db.CreateCon();
                    con1.Open();
                    SqlCommand cmd1 = new SqlCommand(SelStr con1);
                    cmd1.Parameters.AddWithValue(“@teaid“ this.usernameTextBox.Text);
                    cmd1.Parameters.AddWithValue(“teapwd“ this.userpwdTextBox.Text);
                    SqlDataReader sdr1 = cmd1.ExecuteReader();
                    if (sdr1.Read())
                    {
                        Session[“type“] = 2;
                        Session[“username“] = this.usernameTextBox.Text;
                        Response.Redirect(“~/Web/TeacherLookCource.aspx“);
                    }
                    else
                    {
                        Response.Write(“ript>alert(‘error‘);history.back()ript>“);
                    }
                    break;
                default:
                    break;

            }


            //string str = “select * from tb_student where stuid=‘“ + this.TextBox1.Text + “‘“;
            //Student student = new S

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    3145728  2012-02-01 20:34  网上选课\ElectClass.mdf

     文件    1048576  2012-02-01 20:34  网上选课\ElectClass_log.ldf

     文件       3751  2011-12-13 20:31  网上选课\网上选课\Admin\AddCource.aspx

     文件       1858  2011-12-13 20:26  网上选课\网上选课\Admin\AddCource.aspx.cs

     文件       3662  2011-12-13 20:22  网上选课\网上选课\Admin\AddCource.aspx.designer.cs

     文件       1609  2011-12-12 21:13  网上选课\网上选课\Admin\AddDepart.aspx

     文件       1565  2011-12-12 20:34  网上选课\网上选课\Admin\AddDepart.aspx.cs

     文件       2283  2011-12-12 20:35  网上选课\网上选课\Admin\AddDepart.aspx.designer.cs

     文件       4471  2011-12-12 21:58  网上选课\网上选课\Admin\AddStudent.aspx

     文件       2492  2011-12-12 21:52  网上选课\网上选课\Admin\AddStudent.aspx.cs

     文件       3346  2011-12-12 21:39  网上选课\网上选课\Admin\AddStudent.aspx.designer.cs

     文件       2571  2011-12-13 19:42  网上选课\网上选课\Admin\AddTeacher.aspx

     文件       2290  2011-12-13 18:55  网上选课\网上选课\Admin\AddTeacher.aspx.cs

     文件       3395  2011-12-13 19:00  网上选课\网上选课\Admin\AddTeacher.aspx.designer.cs

     文件        693  2011-12-13 19:54  网上选课\网上选课\Admin\AdminDefault.aspx

     文件        515  2011-12-12 19:04  网上选课\网上选课\Admin\AdminDefault.aspx.cs

     文件        519  2011-12-13 19:42  网上选课\网上选课\Admin\AdminDefault.aspx.designer.cs

     文件       1764  2011-12-14 22:14  网上选课\网上选课\Admin\AdminScore.aspx

     文件       1819  2011-12-14 22:09  网上选课\网上选课\Admin\AdminScore.aspx.cs

     文件       1553  2011-12-14 22:07  网上选课\网上选课\Admin\AdminScore.aspx.designer.cs

     文件       7377  2011-12-13 22:14  网上选课\网上选课\Admin\ManageCource.aspx

     文件       4756  2011-12-13 21:38  网上选课\网上选课\Admin\ManageCource.aspx.cs

     文件       3693  2011-12-13 21:22  网上选课\网上选课\Admin\ManageCource.aspx.designer.cs

     文件       1400  2011-12-12 21:13  网上选课\网上选课\Admin\ManageDepart.aspx

     文件       2326  2011-12-12 21:10  网上选课\网上选课\Admin\ManageDepart.aspx.cs

     文件        865  2011-12-12 20:44  网上选课\网上选课\Admin\ManageDepart.aspx.designer.cs

     文件       2376  2011-12-14 00:08  网上选课\网上选课\Admin\ManageStudent.aspx

     文件       4778  2011-12-12 22:53  网上选课\网上选课\Admin\ManageStudent.aspx.cs

     文件        868  2011-12-12 22:00  网上选课\网上选课\Admin\ManageStudent.aspx.designer.cs

     文件       2076  2011-12-13 19:31  网上选课\网上选课\Admin\ManageTeacher.aspx

............此处省略47个文件信息

评论

共有 条评论