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


当前文件路径:HouseManage/ClientManage/ClientLeaseForm.aspx.cs 文件类型
普通视图
		            
1//文件名:ClientLeaseForm.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 13using System.Data.SqlClient; 14public partial class ClientManage_ClientLeaseForm : 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("C2") > 1) 20 { 21 Server.Transfer("~/SystemManage/AllErrorHelp.aspx"); 22 } 23 if (!IsPostBack) 24 { 25 String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyHouseDBConnectionString"].ConnectionString; 26 string MySQL = "Select * From 房源参数 Where 自编号='CQ001'"; 27 SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); 28 MyConnection.Open(); 29 DataTable MyHouseTable = new DataTable(); 30 SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection); 31 MyAdapter.Fill(MyHouseTable); 32 string MyName = "城区"; 33 string MyValue = MyHouseTable.Rows[0][MyName].ToString(); 34 String[] MyDistData = MyValue.Split(new char[1] { '' }); 35 //设置所在城区列表项 36 foreach (String MyString in MyDistData) 37 { 38 this.DropDownList2.Items.Add(MyString); 39 } 40 MyName = "装修"; 41 MyValue = MyHouseTable.Rows[0][MyName].ToString(); 42 String[] MyDecoData = MyValue.Split(new char[1] { '' }); 43 foreach (String MyString in MyDecoData) 44 { 45 this.DropDownList3.Items.Add(MyString); 46 } 47 MyName = "付佣"; 48 MyValue = MyHouseTable.Rows[0][MyName].ToString(); 49 String[] MyFeeData = MyValue.Split(new char[1] { '' }); 50 foreach (String MyString in MyFeeData) 51 { 52 this.DropDownList5.Items.Add(MyString); 53 } 54 MyName = "状态"; 55 MyValue = MyHouseTable.Rows[0][MyName].ToString(); 56 String[] MyStatusData = MyValue.Split(new char[1] { '' }); 57 foreach (String MyString in MyStatusData) 58 { 59 this.DropDownList8.Items.Add(MyString); 60 } 61 MyName = "来源"; 62 MyValue = MyHouseTable.Rows[0][MyName].ToString(); 63 String[] MyInfoData = MyValue.Split(new char[1] { '' }); 64 foreach (String MyString in MyInfoData) 65 { 66 this.DropDownList6.Items.Add(MyString); 67 } 68 MySQL = "Select * From 职员信息"; 69 DataTable MyPersonnelTable = new DataTable(); 70 MyAdapter = new SqlDataAdapter(MySQL, MyConnection); 71 MyAdapter.Fill(MyPersonnelTable); 72 MyName = "职员姓名"; 73 MyValue = MyPersonnelTable.Rows[0][MyName].ToString(); 74 foreach (DataRow MyRow in MyPersonnelTable.Rows) 75 { 76 this.DropDownList7.Items.Add(MyRow[MyName].ToString()); 77 } 78 if (MyConnection.State == ConnectionState.Open) 79 { 80 MyConnection.Close(); 81 } 82 } 83 } 84 protected void Button2_Click(object sender, EventArgs e) 85 {//新增求租客源信息 86 this.SqlDataSource1.Insert(); 87 } 88 protected void Button3_Click(object sender, EventArgs e) 89 {//修改求租客源信息 90 this.SqlDataSource1.Update(); 91 } 92 protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) 93 {//弹出删除操作确认对话框 94 if (e.Row.RowType == DataControlRowType.DataRow) 95 { 96 Button MyButton = (Button)e.Row.FindControl("Button1"); 97 MyButton.OnClientClick = "return confirm('是否确认删除当前选择的记录?')"; 98 } 99 } 100 protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) 101 {//在控件中显示选择的记录 102 this.TextBox2.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); 103 this.TextBox3.Text = this.GridView1.SelectedRow.Cells[3].Text.ToString(); 104 this.DropDownList1.SelectedValue = this.GridView1.SelectedRow.Cells[4].Text.ToString(); 105 this.TextBox5.Text = this.GridView1.SelectedRow.Cells[5].Text.ToString(); 106 this.TextBox6.Text = this.GridView1.SelectedRow.Cells[6].Text.ToString(); 107 this.TextBox7.Text = this.GridView1.SelectedRow.Cells[7].Text.ToString(); 108 this.TextBox8.Text = this.GridView1.SelectedRow.Cells[8].Text.ToString(); 109 this.CheckBox1.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[9].Text.ToString()) == 1) ? true : false; 110 this.DropDownList2.SelectedValue = this.GridView1.SelectedRow.Cells[10].Text.ToString(); 111 this.TextBox11.Text = this.GridView1.SelectedRow.Cells[11].Text.ToString(); 112 this.TextBox12.Text = this.GridView1.SelectedRow.Cells[12].Text.ToString(); 113 this.TextBox13.Text = this.GridView1.SelectedRow.Cells[13].Text.ToString(); 114 this.DropDownList3.SelectedValue = this.GridView1.SelectedRow.Cells[14].Text.ToString(); 115 this.TextBox15.Text = this.GridView1.SelectedRow.Cells[15].Text.ToString(); 116 this.TextBox16.Text = this.GridView1.SelectedRow.Cells[16].Text.ToString(); 117 this.TextBox17.Text = this.GridView1.SelectedRow.Cells[17].Text.ToString(); 118 this.DropDownList4.SelectedValue = this.GridView1.SelectedRow.Cells[18].Text.ToString(); 119 this.TextBox19.Text = this.GridView1.SelectedRow.Cells[19].Text.ToString(); 120 this.TextBox20.Text = this.GridView1.SelectedRow.Cells[20].Text.ToString(); 121 this.TextBox21.Text = this.GridView1.SelectedRow.Cells[21].Text.ToString(); 122 this.TextBox22.Text = this.GridView1.SelectedRow.Cells[22].Text.ToString(); 123 this.TextBox23.Text = this.GridView1.SelectedRow.Cells[23].Text.ToString(); 124 this.TextBox24.Text = this.GridView1.SelectedRow.Cells[24].Text.ToString(); 125 this.TextBox25.Text = this.GridView1.SelectedRow.Cells[25].Text.ToString(); 126 this.TextBox26.Text = this.GridView1.SelectedRow.Cells[26].Text.ToString(); 127 this.DropDownList5.SelectedValue = this.GridView1.SelectedRow.Cells[27].Text.ToString(); 128 this.DropDownList6.SelectedValue = this.GridView1.SelectedRow.Cells[28].Text.ToString(); 129 this.TextBox29.Text = this.GridView1.SelectedRow.Cells[29].Text.ToString(); 130 this.DropDownList7.SelectedValue = this.GridView1.SelectedRow.Cells[30].Text.ToString(); 131 this.CheckBox2.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[31].Text.ToString()) == 1) ? true : false; 132 this.CheckBox3.Checked = (Convert.ToInt16(this.GridView1.SelectedRow.Cells[32].Text.ToString()) == 1) ? true : false; 133 this.DropDownList8.SelectedValue = this.GridView1.SelectedRow.Cells[33].Text.ToString(); 134 this.TextBox34.Text = this.GridView1.SelectedRow.Cells[34].Text.ToString(); 135 } 136} 137 138
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:Asp.net房产中介管理系统源码及常用文档

- yeal简化留言板源代码(学习版)

- SuTusoft企业网站全站源码

- 小付文件上传下载系统

- Ajax实现的在线聊天室

- 汽车配件公司网站(VB.net+Ac..

- ASP.NET通用权限管理系统1.0..

- Asp.net企业网站管理系统源码..

- 逐迹(AspxNuke)CMS v2.0.0.3源码

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