?? teacherreg.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;
public partial class SystemManage_TeacherReg : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
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 BtnAddTeacher_Click(object sender, EventArgs e)
{
SqlData sql = new SqlData();
String[] StrAll ={ "注冊成功", "注冊失敗!" ,"注冊的內(nèi)容不能為空!","此工號已經(jīng)存在","讀數(shù)據(jù)庫發(fā)生錯誤","密碼與驗證不一致"};
String StrTno = TxtTno.Text.ToString();
String StrTname = TxtTname.Text.ToString();
String StrTPassword = TxtTPassword.Text.ToString();
String StrComfirm = TxtConfirm.Text.ToString();
String[] InsertStr ={ StrTno, StrTname, StrTPassword };
if (StrTno != "" && StrTname != "" && StrTPassword != "" && StrComfirm != "")
{
String TableName = "TAB_TEACHER";
String ColumnName = "TNO";
if (sql.CheckStringUnique(TableName, ColumnName, StrTno) == 2)
{
if (StrTPassword == StrComfirm)
{
if (sql.InsertRow(TableName, InsertStr, InsertStr.Length) == true)
{
Dialog(StrAll[0]);
Response.Write(@"<script type='text/JavaScript'>");
Response.Write(@"window.location='./Login.aspx';");
Response.Write(@"</script>");
}
else
{
Dialog(StrAll[1]);
}
}
else
{
Dialog(StrAll[5]);
}
}
else if (sql.CheckStringUnique(TableName, ColumnName, StrTno) == 1)
{
Dialog(StrAll[3]);
}
else
{
Dialog(StrAll[4]);
}
}
else
{
Dialog(StrAll[2]);
}
}
protected void BtnGoback_Click(object sender, EventArgs e)
{
if (Session["USERSTYLE"] == "TEACHER")
{
Response.Write(@"<script type='text/JavaScript'>");
Response.Write(@"window.location='./TeacherMain.aspx';");
Response.Write(@"</script>");
}
else
{
Response.Write(@"<script type='text/JavaScript'>");
Response.Write(@"window.location='./Login.aspx';");
Response.Write(@"</script>");
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -