温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:高校教师档案管理系统项目源码
当前文件:
TeacherFileProject/PersonRecord/Resume_Work.aspx.cs,打开代码结构图
TeacherFileProject/PersonRecord/Resume_Work.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
13
public partial class PersonRecord_Resume_Work : System.Web.UI.Page 14
{ 15
PersonRecordClass prObj = new PersonRecordClass(); 16
protected void Page_Load(object sender, EventArgs e) 17
{ 18
if (!IsPostBack) 19
{ 20
if ((Session["isOpen"] == null) && (Session["Admin"] == null)) 21
{ 22
Response.Write("<script>parent.location='../Default.aspx';</script>"); 23
} 24
else 25
{ 26
27
tabList.Visible = false; 28
tabAdd.Visible = false; 29
tabUpdate.Visible = false; 30
btnListAdd.Visible = false; 31
if (Convert.ToInt32(Session["isOpen"]) == 1 || Convert.ToInt32(Session["Admin"]) == 1) 32
{ 33
tabList.Visible = true; 34
btnListAdd.Visible = true; 35
gvListBind(); 36
37
38
} 39
else 40
{ 41
tabList.Visible = true; 42
btnListAdd.Visible = false; 43
gvListBind(); 44
gvList.Columns[0].Visible = false; 45
gvList.Columns[1].Visible = false; 46
} 47
} 48
} 49
} 50
//============================================================= 51
// 方 法 名: gvListBind() 52
// 功能描述: 对GridView进行绑定,显示教师的教育背景和社会实践资料 53
// 输入参数: 无 54
// 返 回 值: 无 55
// ============================================================== 56
public void gvListBind() 57
{ 58
if ((Session["isOpen"] == null) && (Session["Admin"] == null)) 59
{ 60
Response.Write("<script>parent.location='../Default.aspx';</script>"); 61
} 62
else 63
{ 64
if (Convert.ToInt32(Session["Admin"]) == 1) 65
{ 66
SqlCommand myCmd = prObj.GetARICmd(2); 67
prObj.GVBind(myCmd, gvList, "AResume"); 68
} 69
else 70
{ 71
SqlCommand myCmd = prObj.GetSRICmd(2, Convert.ToInt32(Session["UID"])); 72
prObj.GVBind(myCmd, gvList, "SResume"); 73
} 74
75
} 76
77
} 78
//============================================================= 79
// 事 件 名: gvList_RowDeleting() 80
// 功能描述: 对GridView中的某行进行删除 81
// ============================================================== 82
protected void gvList_RowDeleting(object sender, GridViewDeleteEventArgs e) 83
{ 84
int P_Int_id = Convert.ToInt32(gvList.DataKeys[e.RowIndex].Value); 85
prObj.DeleteResumeInfo(P_Int_id); 86
gvListBind(); 87
} 88
//============================================================= 89
// 事 件 名: gvList_RowUpdating() 90
// 功能描述: 对GridView中的某行进行修改时,修改表显示其修改内容 91
// ============================================================== 92
protected void gvList_RowUpdating(object sender, GridViewUpdateEventArgs e) 93
{ 94
tabUpdate.Visible = true; 95
tabList.Visible = false; 96
tabAdd.Visible = false; 97
prObj.DDLBind(ddlUYearInfo); 98
int P_Int_id = Convert.ToInt32(gvList.DataKeys[e.RowIndex].Value); 99
labValue.Text = P_Int_id.ToString(); 100
DataSet ds = prObj.ReturnRIDs(2, P_Int_id, "ResumeInfo"); 101
txtName.Text= ds.Tables["ResumeInfo"].Rows[0][0].ToString (); 102
txtUStartEndTime.Text = ds.Tables["ResumeInfo"].Rows[0][1].ToString(); 103
txtUWorkPlace.Text = ds.Tables["ResumeInfo"].Rows[0][2].ToString(); 104
txtUWorking.Text = ds.Tables["ResumeInfo"].Rows[0][3].ToString (); 105
txtUDegree.Text = ds.Tables["ResumeInfo"].Rows[0][4].ToString(); 106
ddlUYearInfo.SelectedItem.Text = ds.Tables["ResumeInfo"].Rows[0][5].ToString(); 107
txtUStatus.Text = ds.Tables["ResumeInfo"].Rows[0][6].ToString(); 108
109
} 110
//============================================================= 111
// 事 件 名: btnUpdate_Click() 112
// 功能描述: 在修改表上,单击修改按钮时,修改教师的教育背景和社会实践资料 113
// ============================================================== 114
protected void btnUpdate_Click(object sender, EventArgs e) 115
{ 116
if (Session["Username"] == null) 117
{ 118
Response.Write("<script>parent.location='../Default.aspx';</script>"); 119
} 120
else 121
{ 122
if (txtUStartEndTime.Text.Trim() == "") 123
{ 124
Response.Write("<script>alert('请填写起止时间!');</script>"); 125
126
} 127
else if (txtUWorkPlace.Text.Trim() == "") 128
{ 129
Response.Write("<script>alert('请填写工作单位!');</script>"); 130
131
} 132
else if (txtUWorking.Text.Trim() == "") 133
{ 134
Response.Write("<script>alert('请填写职务!');</script>"); 135
136
} 137
else if(txtUStatus.Text.Trim()=="") 138
{ 139
Response.Write("<script>alert('请填写职称!');</script>"); 140
} 141
else if (txtUDegree.Text.Trim() == "") 142
{ 143
Response.Write("<script>alert('请填写在各级学术机构中的任职情况!');</script>"); 144
} 145
else 146
{ 147
prObj.UpdateResumeInfo(Convert.ToInt32(labValue.Text.Trim()), txtUStartEndTime.Text.Trim(), txtUWorkPlace.Text.Trim(), txtUWorking.Text.Trim(), txtUDegree.Text.Trim(),txtUStatus.Text.Trim(), 2, Convert.ToString(Session["Username"]), Convert.ToInt32(ddlUYearInfo.SelectedItem.ToString()),Convert.ToInt32(Session["UID"])); 148
Response.Redirect("~/PersonRecord/Resume_Work.aspx"); 149
} 150
} 151
} 152
//============================================================= 153
// 事 件 名: lnkbtnAdd_Click() 154
// 功能描述: 当用户单击添加按钮,添加表显示 155
// ============================================================== 156
protected void btnListAdd_Click(object sender, EventArgs e) 157
{ 158
tabAdd.Visible = true; 159
tabList.Visible = false; 160
tabUpdate.Visible = false; 161
prObj.DDLBind(ddlAYearInfo); 162
prObj.DDLNameBind(ddlName, "userInfo"); 163
if ((Session["isOpen"] == null) && (Session["Admin"] == null)) 164
{ 165
Response.Write("<script>parent.location='../Default.aspx';</script>"); 166
} 167
else 168
{ 169
if (Convert.ToInt32(Session["Admin"]) == 1) 170
{ } 171
else 172
{ 173
ddlName.SelectedValue = Convert.ToString(Session["UID"]); 174
ddlName.Enabled = false; 175
176
} 177
} 178
} 179
//============================================================= 180
// 事 件 名: btnAAdd_Click() 181
// 功能描述: 在添加表上,单击添加按钮时,将教师的教育背景和社会实践资料添加到表tb_Resume中 182
// ============================================================== 183
protected void btnAAdd_Click(object sender, EventArgs e) 184
{ 185
if (Session["Username"] == null) 186
{ 187
Response.Write("<script>parent.location='../Default.aspx';</script>"); 188
} 189
else 190
{ 191
if (ddlName.SelectedIndex == 0) 192
{ 193
Response.Write("<script>alert('请选择需要添加资料的姓名!');</script>"); 194
} 195
else if (txtAStartEndTime.Text.Trim() == "") 196
{ 197
Response.Write("<script>alert('请填写起止时间!');</script>"); 198
199
} 200
else if (txtAWorkPlace.Text.Trim() == "") 201
{ 202
Response.Write("<script>alert('请填工作单位!');</script>"); 203
204
} 205
else if (txtAWorking.Text.Trim() == "") 206
{ 207
Response.Write("<script>alert('请填写职务!');</script>"); 208
209
} 210
else if (txtADegree.Text.Trim() == "") 211
{ 212
Response.Write("<script>alert('请填写职称!');</script>"); 213
} 214
else if (ddlAYearInfo.SelectedIndex == 0) 215
{ 216
Response.Write("<script>alert('请选择填写年度!');</script>"); 217
} 218
else if (txtAStatus.Text.Trim() =="") 219
{ 220
Response.Write("<script>alert('请填写在各级学术机构中的任职情况!');</script>"); 221
} 222
else 223
{ 224
prObj.AddResumeInfo(txtAStartEndTime.Text.Trim(), txtAWorkPlace.Text.Trim(), txtAWorking.Text.Trim(), txtADegree.Text.Trim(), txtAStatus.Text.Trim(), 2, Convert.ToInt32(ddlName.SelectedValue.ToString()), Convert.ToString(Session["Username"]), "", Convert.ToInt32(ddlAYearInfo.SelectedItem.ToString()),Convert.ToInt32(Session["UID"])); 225
Response.Redirect("~/PersonRecord/Resume_Work.aspx"); 226
} 227
} 228
} 229
//============================================================= 230
// 事 件 名: btnAReset_Click() 231
// 功能描述: 在添加表上,单击重置按钮时,重新填写教师的教育背景和社会实践资料 232
// ============================================================== 233
protected void btnAReset_Click(object sender, EventArgs e) 234
{ 235
236
txtAStartEndTime.Text = ""; 237
txtAWorkPlace.Text = ""; 238
txtAWorking.Text = ""; 239
txtAStatus.Text = ""; 240
txtADegree.Text = ""; 241
ddlAYearInfo.SelectedIndex = 0; 242
} 243
protected void gvList_PageIndexChanging(object sender, GridViewPageEventArgs e) 244
{ 245
gvList.PageIndex = e.NewPageIndex; 246
gvListBind(); 247
} 248
} 249




PersonRecordClass prObj 
}
}