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


当前文件路径:HouseManage/ContractManage/ContractForm.aspx.cs 文件类型
普通视图
		            
1//文件名:ContractForm.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 ContractManage_ContractForm : 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("D3") > 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[] MyPayData = MyValue.Split(new char[1] { '' }); 35 foreach (String MyString in MyPayData) 36 { 37 this.DropDownList3.Items.Add(MyString); 38 } 39 MySQL = "Select * From 职员信息"; 40 DataTable MyPersonnelTable = new DataTable(); 41 MyAdapter = new SqlDataAdapter(MySQL, MyConnection); 42 MyAdapter.Fill(MyPersonnelTable); 43 MyName = "职员姓名"; 44 MyValue = MyPersonnelTable.Rows[0][MyName].ToString(); 45 foreach (DataRow MyRow in MyPersonnelTable.Rows) 46 { 47 this.DropDownList1.Items.Add(MyRow[MyName].ToString()); 48 } 49 if (MyConnection.State == ConnectionState.Open) 50 { 51 MyConnection.Close(); 52 } 53 } 54 } 55 protected void Button4_Click(object sender, EventArgs e) 56 {//显示合同文件 57 string MyPath = HttpContext.Current.Server.MapPath("~/FileData/") + this.TextBox18.Text; 58 System.Diagnostics.Process.Start(MyPath); 59 } 60 protected void btnUpload_Click(object sender, EventArgs e) 61 {//上传合同文件 62 string MyFileName = this.FileUpload1.FileName; 63 string MyTargetFile = System.IO.Path.Combine(HttpContext.Current.Server.MapPath("~/FileData/"), MyFileName); 64 this.FileUpload1.PostedFile.SaveAs(MyTargetFile); 65 } 66 protected void Button2_Click(object sender, EventArgs e) 67 {//新增租售成交信息 68 String MySQLConnectionString = ConfigurationManager.ConnectionStrings["MyHouseDBConnectionString"].ConnectionString; 69 string MySQL = "Select * From 租售成交 Where (资料类型='" + this.DropDownList2.Text + "') AND (资料编号='" + this.TextBox7.Text + "')"; 70 SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); 71 MyConnection.Open(); 72 DataTable MyQueryTable = new DataTable(); 73 SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection); 74 MyAdapter.Fill(MyQueryTable); 75 if (MyQueryTable.Rows.Count > 0) 76 return; 77 if (MyConnection.State == ConnectionState.Open) 78 { 79 MyConnection.Close(); 80 } 81 this.SqlDataSource1.Insert(); 82 } 83 protected void Button3_Click(object sender, EventArgs e) 84 {//修改租售成交信息 85 this.SqlDataSource1.Update(); 86 } 87 protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) 88 {//弹出删除操作确认对话框 89 if (e.Row.RowType == DataControlRowType.DataRow) 90 { 91 Button MyButton = (Button)e.Row.FindControl("Button1"); 92 MyButton.OnClientClick = "return confirm('是否确认删除当前选择的记录?')"; 93 } 94 } 95 protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) 96 {//在控件中显示选择的记录 97 this.TextBox20.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); 98 this.DropDownList1.SelectedValue = this.GridView1.SelectedRow.Cells[3].Text.ToString(); 99 this.DropDownList2.SelectedValue = this.GridView1.SelectedRow.Cells[4].Text.ToString(); 100 this.TextBox7.Text = this.GridView1.SelectedRow.Cells[5].Text.ToString(); 101 this.TextBox8.Text = this.GridView1.SelectedRow.Cells[6].Text.ToString(); 102 this.TextBox9.Text = this.GridView1.SelectedRow.Cells[7].Text.ToString(); 103 this.TextBox10.Text = this.GridView1.SelectedRow.Cells[8].Text.ToString(); 104 this.DropDownList3.SelectedValue = this.GridView1.SelectedRow.Cells[9].Text.ToString(); 105 this.TextBox12.Text = this.GridView1.SelectedRow.Cells[10].Text.ToString(); 106 this.TextBox13.Text = this.GridView1.SelectedRow.Cells[11].Text.ToString(); 107 this.TextBox14.Text = this.GridView1.SelectedRow.Cells[12].Text.ToString(); 108 this.TextBox15.Text = this.GridView1.SelectedRow.Cells[13].Text.ToString(); 109 this.TextBox16.Text = this.GridView1.SelectedRow.Cells[14].Text.ToString(); 110 this.TextBox17.Text = this.GridView1.SelectedRow.Cells[15].Text.ToString(); 111 this.TextBox18.Text = this.GridView1.SelectedRow.Cells[16].Text.ToString(); 112 this.TextBox19.Text = this.GridView1.SelectedRow.Cells[17].Text.ToString(); 113 } 114} 115
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:Asp.net房产中介管理系统源码及常用文档

- 某物流网站源码

- 星光慧点图书租借管理系统源码

- Maolz个人展示网站源码

- FreeTextBox 1.6.3 中文版及源码

- 天织在线购物网站完整源码及文档

- SubText1.9.4完整免安装源码..

- 三层(工厂模式)简单留言板

- 勇敢者论坛1.0完整源代码

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