您目前尚未登陆,请选择【登陆】或【注册
首页->行政办公->小区物业管理系统源码>>admin/editbaseinfo.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:小区物业管理系统源码
当前文件:文件类型 SmallHouse/admin/editbaseinfo.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 admin_editbaseinfo : System.Web.UI.Page 14{ 15 16 BaseClass bc = new BaseClass();//定义公共类的实例,参见App_Code/baseClass.cs 17 protected void Page_Load(object sender, EventArgs e) 18 { 19 20 if (Convert.ToString(Session["UID"]) == "") 21 { 22 Response.Redirect("login.aspx"); 23 24 } 25 26 if(!IsPostBack) 27 { 28 this.bind(); 29 } 30 31 32 33 } 34 35 protected void bind() 36 { 37 38 39 40 string strsql = "select * from baseInfo"; 41 SqlDataReader mydr = bc.ExecRead(strsql); 42 if (mydr.Read()) 43 { 44 45 46 //Response.Write(mydr["ownerID"].ToString()); 47 //Response.End(); 48 49 50 TextBox1.Text =mydr["homeName"].ToString(); 51 TextBox2.Text = mydr["mainHead"].ToString(); 52 53 selectdate.Text = mydr["buildDate"].ToString(); 54 55 TextBox4.Text = mydr["buildArea"].ToString(); 56 TextBox5.Text = mydr["amount"].ToString(); 57 TextBox6.Text = mydr["address"].ToString(); 58 TextBox7.Text = mydr["greenArea"].ToString(); 59 TextBox8.Text = mydr["roadArea"].ToString(); 60 TextBox9.Text = mydr["tel"].ToString(); 61 TextBox10.Text = mydr["parkingArea"].ToString(); 62 txtmemo.Text = mydr["memo"].ToString(); 63 64 65 } 66 67 else 68 { 69 Response.Write("<script>alert('数据加载失败!请重试');</script>"); 70 return; 71 } 72 73 74 75 bc.Closeconn();//关闭数据库的连接 76 77 78 79 80 81 82 } 83 protected void Button1_Click(object sender, EventArgs e) 84 { 85 86 87 string sqlstr = "update baseInfo set homeName='" + TextBox1.Text + "',mainHead='" + TextBox2.Text + "',buildDate='" +selectdate.Text + "',"; 88 sqlstr=sqlstr+"buildArea='"+TextBox4.Text+"',amount='"+TextBox5.Text+"',address='"+TextBox6.Text+"',greenArea='"+TextBox7.Text+"',"; 89 sqlstr=sqlstr+"roadArea='"+TextBox8.Text+"',tel='"+TextBox9.Text+"',parkingArea='"+TextBox10.Text+"',memo='"+txtmemo.Text+"'"; 90 //Response.Write(sqlstr); 91 //Response.End(); 92 93 if (bc.ExecSql(sqlstr)) 94 { 95 96 Response.Write("<script language=javascript>alert('小区信息修改成功!');location='baseinfo.aspx'</script>"); 97 98 } 99 else 100 { 101 Response.Write("<script>alert('修改失败,请重试!');</script>"); 102 } 103 } 104 protected void Button2_Click(object sender, EventArgs e) 105 { 106 Response.Redirect("default.aspx"); 107 } 108} 109
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:小区物业管理系统源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号