?? register.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_Register : 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 BtnAddUser_Click(object sender, EventArgs e)
{
SqlData sql = new SqlData();
String[] StrAll ={ "注冊成功", "注冊失敗!" ,"注冊的內容不能為空!","此學號已經存在","讀數據庫發生錯誤","密碼與驗證不一致"};
String StrSno = TxtSno.Text.ToString();
String StrSname = TxtSname.Text.ToString();
String StrSPassword = TxtSPassword.Text.ToString();
String StrComfirm = TxtConfirm.Text.ToString();
String StrSClass = TxtSClass.Text.ToString();
String[] InsertStr ={ StrSno, StrSname, StrSClass, StrSPassword };
if (StrSno != "" && StrSname != "" && StrSPassword != "" && StrComfirm != "" && StrSClass != "")
{
String TableName = "TAB_STUDENT";
String ColumnName = "SNO";
if (sql.CheckStringUnique(TableName, ColumnName, StrSno) == 2)
{
if (StrSPassword == 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, StrSno) == 1)
{
Dialog(StrAll[3]);
}
else
{
Dialog(StrAll[4]);
}
}
else
{
Dialog(StrAll[2]);
}
}
protected void BtnGoback_Click(object sender, EventArgs e)
{
if (Session["USERSTYLE"] =="STUDENT")
{
Response.Write(@"<script type='text/JavaScript'>");
Response.Write(@"window.location='./Main.aspx';");
Response.Write(@"</script>");
}
else
{
Response.Write(@"<script type='text/JavaScript'>");
Response.Write(@"window.location='./Login.aspx';");
Response.Write(@"</script>");
}
}
protected void AddUserBut_Click(object sender, EventArgs e)
{
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -