温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:高校教师档案管理系统项目源码
当前文件:
TeacherFileProject/Manager/SystemAdmin.aspx.cs,打开代码结构图
TeacherFileProject/Manager/SystemAdmin.aspx.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using System.Data.SqlClient; 12
using System.Text.RegularExpressions; 13
14
public partial class Manager_Systemadmin : System.Web.UI.Page 15
{ 16
ManagerClass mcObj = new ManagerClass(); 17
DBClass dbObj = new DBClass(); 18
PersonRecordClass prObj = new PersonRecordClass(); 19
protected void Page_Load(object sender, EventArgs e) 20
{ 21
if (!IsPostBack) 22
{ 23
if (Session["Admin"] == null) 24
{ 25
Response.Write("<script>parent.location='../Default.aspx';</script>"); 26
} 27
else 28
{ 29
gvListBind(); 30
} 31
} 32
} 33
/// <summary> 34
/// 对GridView进行绑定,显示系统设置信息 35
/// </summary> 36
public void gvListBind() 37
{ 38
if (Session["Admin"] == null) 39
{ 40
Response.Write("<script>parent.location='../Default.aspx';</script>"); 41
} 42
else 43
{ 44
SqlCommand myCmd = mcObj.GetConfigCmd(); 45
prObj.GVBind(myCmd, gvList, "Config"); 46
} 47
48
} 49
protected void gvList_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) 50
{ 51
gvList.EditIndex = -1; 52
gvListBind(); 53
} 54
protected void gvList_RowEditing(object sender, GridViewEditEventArgs e) 55
{ 56
gvList.EditIndex = e.NewEditIndex; 57
gvListBind(); 58
} 59
protected void gvList_RowUpdating(object sender, GridViewUpdateEventArgs e) 60
{ 61
Session["isOpen"] = ""; 62
Session["isSearch"] = ""; 63
string P_Str_IO = ((TextBox)(gvList.Rows[e.RowIndex].Cells[1].Controls[0])).Text.Trim(); 64
string P_Str_IS = ((TextBox)(gvList.Rows[e.RowIndex].Cells[0].Controls[0])).Text.Trim(); 65
bool P_BL_isOpen; 66
bool P_BL_isSearch; 67
if ((P_Str_IO.Trim() == "开放" || P_Str_IO.Trim() == "不开放") && (P_Str_IS.Trim() == "开放" || P_Str_IS.Trim() == "不开放")) 68
{ 69
if (P_Str_IO.Trim() == "开放") 70
{ 71
P_BL_isOpen = true; 72
Session["isOpen"] = 1; 73
} 74
else 75
{ 76
P_BL_isOpen = false; 77
Session["isOpen"] = 0; 78
} 79
if (P_Str_IS.Trim() == "开放") 80
{ 81
P_BL_isSearch = true; 82
Session["isSearch"] = 1; 83
} 84
else 85
{ 86
P_BL_isSearch = false; 87
Session["isSearch"] = 0; 88
} 89
90
mcObj.UpdateConfig(Convert.ToInt32(gvList.DataKeys[e.RowIndex].Value.ToString()), P_BL_isOpen, P_BL_isSearch); 91
gvList.EditIndex = -1; 92
gvListBind(); 93
} 94
else 95
{ 96
Response.Write("<script>alert('只能输入开放或不开放,请正确的输入!')</script>"); 97
98
} 99
100
} 101
102
} 103




ManagerClass mcObj 
}
}