温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:人事管理系统(课程设计)源码
当前文件:
Mispersonal/WebFiles/Department/Add_Depart.aspx.cs,打开代码结构图
Mispersonal/WebFiles/Department/Add_Depart.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
//该源码下载自www.51aspx.com(51aspx.com) 13
14
public partial class WebFiles_Department_Add_Depart : System.Web.UI.Page 15
{ 16
protected void Page_Load(object sender, EventArgs e) 17
{ 18
19
} 20
protected void btn_add_Click(object sender, EventArgs e) 21
{ 22
if (tb_id.Text.Trim() == "") 23
{ 24
Response.Write("<script>alert('部门编号不能为空')</script>"); 25
return; 26
} 27
if (tb_name.Text.Trim() == "") 28
{ 29
Response.Write("<script>alert('部门名称不能为空')</script>"); 30
return; 31
} 32
if (tb_tel.Text.Trim() == "") 33
{ 34
Response.Write("<script>alert('联系电话不能为空')</script>"); 35
return; 36
} 37
if (tb_address.Text.Trim() == "") 38
{ 39
Response.Write("<script>alert('联系地址不能为空')</script>"); 40
return; 41
} 42
if (tb_chief.Text.Trim() == "") 43
{ 44
Response.Write("<script>alert('负责人不能为空')</script>"); 45
return; 46
} 47
if (tb_belong.Text.Trim() == "") 48
{ 49
Response.Write("<script>alert('所属部门不能为空')</script>"); 50
return; 51
} 52
department Add_depart = new department(); 53
Add_depart.Insert(tb_id.Text, tb_name.Text,tb_tel.Text, tb_address.Text,tb_chief.Text,tb_belong.Text); 54
55
Response.Redirect("~/WebFiles/Department/List_Depart.aspx"); 56
} 57
} 58





}
}