?? byhand_snytax.aspx.cs.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("對不起,你沒有權(quán)限訪問這個頁面!");
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");
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -