⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 byhand_snytax.aspx.cs.svn-base

📁 大学英语学习系统
💻 SVN-BASE
字号:
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;
using System.Data.SqlClient;
public partial class AutoManage_ByHand_Snytax : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["USERSTYLE"] == "TEACHER")
        {
        }
        else
        {
            Dialog("对不起,你没有权限访问这个页面!");
            Response.Redirect("~/SystemManage/Login.aspx");
        }
    }
    private void Dialog(String Str)
    {
        Response.Write(@"<script type='text/JavaScript'>");
        Response.Write(@"alert('" + Str + "');");
        //Response.Write(@"window.location='./list_logingroup.aspx';");
        Response.Write(@"</script>");
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string id = "" + GridView1.DataKeys[GridView1.SelectedIndex].Values[0];
        string ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection myConnection = new SqlConnection(ConnectionString);
        string sql = "SELECT TSCONTENT FROM V_TESTSYNTAX WHERE TSNO='" + id + "'";
        SqlDataAdapter command = new SqlDataAdapter(sql, myConnection);
        myConnection.Open();
        DataSet mydataset = new DataSet();
        command.Fill(mydataset, "V_TESTSYNTAX");
        TextBox1.Text = mydataset.Tables[0].Rows[0][0].ToString();

        myConnection.Close();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        int j = 0;
        string[] Yufath = new string[20];
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            bool isChecked = ((CheckBox)GridView1.Rows[i].FindControl("chkSelect")).Checked;
            if (isChecked)
            {
                j++;
                if (j > 20)
                {
                    Dialog("你最多只能选择20个题目!!");
                    return;
                }
                Yufath[j-1] = GridView1.Rows[i].Cells[1].Text;
            }
        }
        Session["Yufath"] = Yufath;
        Server.Transfer("Auto.aspx");
    }
    protected void BtnReturn_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/SystemManage/TeacherMain.aspx");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -