您目前尚未登陆,请选择【登陆】或【注册
首页->行政办公->库存管理系统V1.0源码>>AddPeople.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:库存管理系统V1.0源码
当前文件:文件类型 StoreManage/AddPeople.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using System.Data.SqlClient; 12 13public partial class AddPeople : System.Web.UI.Page 14{ 15 protected void Page_Load(object sender, EventArgs e) 16 { 17 18 } 19 protected void Button1_Click(object sender, EventArgs e) 20 { 21 if (kong()) 22 { 23 //定义变量 24 string aa, bb, cc; 25 aa = this.TextBox1.Text; 26 bb = this.TextBox2.Text; 27 cc = this.TextBox5.Text; 28 SqlConnection scon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]); 29 scon.Open(); 30 SqlCommand scmd = new SqlCommand("insert into people(bianma,Name,tel) values ('" + aa + "','" + bb + "','" + cc + "')", scon); 31 scmd.ExecuteNonQuery(); 32 scmd.Dispose(); 33 scon.Close(); 34 Response.Write("<script language='javascript'>alert('添加成功!');</script>"); 35 Server.Transfer("managePeople.aspx"); 36 } 37 } 38 private bool kong() 39 { 40 if (this.TextBox1.Text == "") 41 { 42 Response.Write("<script language='javascript'>alert('名称不能为空!');</script>"); 43 return false; 44 } 45 else 46 { 47 if (this.TextBox2.Text == "") 48 { 49 Response.Write("<script language='javascript'>alert('编码不能为空!');</script>"); 50 return false; 51 } 52 else 53 { 54 return true; 55 } 56 } 57 } 58 protected void Button2_Click(object sender, EventArgs e) 59 { 60 Server.Transfer("managePeople.aspx"); 61 } 62} 63
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:库存管理系统V1.0源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号