您目前尚未登陆,请选择【登陆】或【注册
首页->行政办公->Asp.net房产中介管理系统源码及常用文档>>CompanyManage/ParameterForm.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:Asp.net房产中介管理系统源码及常用文档


当前文件路径:HouseManage/CompanyManage/ParameterForm.aspx.cs 文件类型
普通视图
		            
1//文件名:ParameterForm.aspx.cs 2using System; 3using System.Data; 4using System.Configuration; 5using System.Collections; 6using System.Web; 7using System.Web.Security; 8using System.Web.UI; 9using System.Web.UI.WebControls; 10using System.Web.UI.WebControls.WebParts; 11using System.Web.UI.HtmlControls; 12//do u know 51aspx? 13using System.Data.SqlClient; 14public partial class CompanyManage_ParameterForm : System.Web.UI.Page 15{ 16 protected void Page_Load(object sender, EventArgs e) 17 { 18 string MyForbidString = Session["MyForbid"].ToString(); 19 if (MyForbidString.IndexOf("A1") > 1) 20 { 21 Server.Transfer("~/SystemManage/AllErrorHelp.aspx"); 22 } 23 this.Button1.OnClientClick = "return confirm('请检查房源参数值是否正确并符合规范,否则保存后发生意外的结果!是否继续?')"; 24 this.Button2.OnClientClick = "return confirm('请检查其他参数值是否正确并符合规范,否则保存后发生意外的结果!是否继续?')"; 25 } 26 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) 27 {//显示房源参数值 28 String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyHouseDBConnectionString"].ConnectionString; 29 string MySQL = "Select * From 房源参数 Where 自编号='CQ001'"; 30 SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); 31 MyConnection.Open(); 32 DataTable MyHouseTable = new DataTable(); 33 SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection); 34 MyAdapter.Fill(MyHouseTable); 35 string MyName = this.DropDownList1.SelectedValue.ToString(); 36 string MyValue = MyHouseTable.Rows[0][MyName].ToString(); 37 String[] MyData = MyValue.Split(new char[1] { '' }); 38 this.TextBox1.Text = ""; 39 foreach (string MyLine in MyData) 40 { 41 if (MyLine.Length > 0) 42 { 43 this.TextBox1.Text += MyLine + ""; 44 } 45 } 46 if (MyConnection.State == ConnectionState.Open) 47 { 48 MyConnection.Close(); 49 } 50 } 51 protected void Button1_Click(object sender, EventArgs e) 52 {//新增房源参数值 53 String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyHouseDBConnectionString"].ConnectionString; 54 SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); 55 MyConnection.Open(); 56 string MyName = this.DropDownList1.SelectedValue.ToString(); 57 string MyValue = this.TextBox1.Text; 58 string MySQL = "Update 房源参数 Set " + MyName + "='" + MyValue + "' Where 自编号='CQ001'"; 59 SqlCommand MyCommand = new SqlCommand(MySQL, MyConnection); 60 MyCommand.ExecuteNonQuery(); 61 if (MyConnection.State == ConnectionState.Open) 62 { 63 MyConnection.Close(); 64 } 65 } 66 protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) 67 {//显示其他参数值 68 String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyHouseDBConnectionString"].ConnectionString; 69 string MySQL = "Select * From 其他参数 Where 自编号='CQ001'"; 70 SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); 71 MyConnection.Open(); 72 DataTable MyHouseTable = new DataTable(); 73 SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection); 74 MyAdapter.Fill(MyHouseTable); 75 string MyName = this.DropDownList2.SelectedValue.ToString(); 76 string MyValue = MyHouseTable.Rows[0][MyName].ToString(); 77 String[] MyData = MyValue.Split(new char[1] { '' }); 78 this.TextBox2.Text = ""; 79 foreach (string MyLine in MyData) 80 { 81 if (MyLine.Length > 0) 82 { 83 this.TextBox2.Text += MyLine + ""; 84 } 85 } 86 if (MyConnection.State == ConnectionState.Open) 87 { 88 MyConnection.Close(); 89 } 90 } 91 protected void Button2_Click(object sender, EventArgs e) 92 {//新增其他参数值 93 String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyHouseDBConnectionString"].ConnectionString; 94 SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); 95 MyConnection.Open(); 96 string MyName = this.DropDownList2.SelectedValue.ToString(); 97 string MyValue = this.TextBox2.Text; 98 string MySQL = "Update 其他参数 Set " + MyName + "='" + MyValue + "' Where 自编号='CQ001'"; 99 SqlCommand MyCommand = new SqlCommand(MySQL, MyConnection); 100 MyCommand.ExecuteNonQuery(); 101 if (MyConnection.State == ConnectionState.Open) 102 { 103 MyConnection.Close(); 104 } 105 } 106} 107
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:Asp.net房产中介管理系统源码及常用文档

- JaneLee简单购物车源码

- 小范企业管理源码

- 大刘单用户Blog(NHibernate..

- 无限级树形(三层开发)源码

- 站长中国绩效考核系统源码

- Asp.net2.0值班管理系统源码

- 18个WebChart曲线/柱状图C#源码

- NBear+NBear开发BBS系统源码

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号