代码解析.ppt_第1页
代码解析.ppt_第2页
代码解析.ppt_第3页
代码解析.ppt_第4页
代码解析.ppt_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

淡 彩 的 黑 板,出售房源模块代码解析,班级:软件101,作者:王彦峰 张春功,代码如下(Showtime):,/文件名:SaleHouseForm.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace MyHouse public partial class SaleHouseForm : Form public SaleHouseForm() InitializeComponent(); ,细节决定成败,代码如下(Showtime):,private void SaleHouseForm_Load(object sender, EventArgs e) / TODO: 这行代码将数据加载到表“myHouseDataSet1.出售房源管理”中。您可以根据需要移动或移除它。 this.出售房源管理TableAdapter.Fill(this.myHouseDataSet1.出售房源管理); String MySQLConnectionString = global:MyHouse.Properties.Settings.Default.MyHouseConnectionString; string MySQL = “Select * From 房源参数字典 Where 自编号=CQ001“; SqlConnection MyConnection = new SqlConnection(MySQLConnectionString); MyConnection.Open(); DataTable MyHouseTable = new DataTable(); SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection); MyAdapter.Fill(MyHouseTable);,一切应用源于需求,代码如下(Showtime):,string MyName = “城区“; string MyValue = MyHouseTable.Rows0MyName.ToString(); String MyDistData = MyValue.Split(new char1 、 ); foreach (String MyString in MyDistData) this.所在城区ComboBox.Items.Add(MyString); MyName = “类型“; MyValue = MyHouseTable.Rows0MyName.ToString(); String MyTypeData = MyValue.Split(new char1 、 ); foreach (String MyString in MyTypeData) this.楼层类型ComboBox.Items.Add(MyString); MyName,创新才是源动力,代码如下(Showtime):, MyName = “用途“; MyValue = MyHouseTable.Rows0MyName.ToString(); String MyUseData = MyValue.Split(new char1 、 ); foreach (String MyString in MyUseData) this.房屋用途ComboBox.Items.Add(MyString); MyName = “产权“; MyValue = MyHouseTable.Rows0MyName.ToString(); String MyPreData = MyValue.Split(new char1 、 ); foreach (String MyString in MyPreData) this.产权性质ComboBox.Items.Add(MyString); 模块代码中 “结构” 装修 证件 付款 货币 付佣 委托 来源 状态 等功能的实现 代码是相似的 这里就不多做介绍了,泱泱海阔凭鱼跃,代码如下(Showtime):, MySQL = “Select * From 公司职员信息“; DataTable MyPersonnelTable = new DataTable(); MyAdapter = new SqlDataAdapter(MySQL, MyConnection); MyAdapter.Fill(MyPersonnelTable); MyName = “姓名“; MyValue = MyPersonnelTable.Rows0MyName.ToString(); foreach (DataRow MyRow in MyPersonnelTable.Rows) this.经纪人ComboBox.Items.Add(MyRowMyName.ToString(); if (MyConnection.State = ConnectionState.Open) MyConnection.Close(); public string MyTel = “; private void 打印ToolStripButton_Click(object sender, EventArgs e) this.printPreviewDialog1.Document = this.printDocument1; this.printPreviewDialog1.ShowDialog(); ,朗朗天高任鸟飞,代码如下(Showtime):, private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) /打印出售房源 e.Graphics.DrawString(“出 售 房 源“ , new Font(“宋体“, 50), Brushes.Black, 220, 40); e.Graphics.DrawLine(new Pen(Color.Black, (float)3.00), 50, 120, 770, 120); e.Graphics.DrawString(“编号:“ + this.自编号TextBox.Text, new Font(“宋体“, 20), Brushes.Black, 50, 140); e.Graphics.DrawString(“位置:“ + this.所在城区ComboBox.Text+this.具体位置TextBox.Text, new Font(“宋体“, 20), Brushes.Black, 350, 140); e.Graphics.DrawLine(new Pen(Color.Black), 50, 170, 770, 170); e.Graphics.DrawString(“类型:“ + this.楼层类型ComboBox.Text+this.房屋结构ComboBox.Text, new Font(“宋体“, 20), Brushes.Black, 50, 190); e.Graphics.DrawString(“楼层:“ + this.楼层TextBox.Text+“/“+this.总层TextBox.Text , new Font(“宋体“, 20), Brushes.Black, 350, 190);,Everyday is a new beginning,代码如下(Showtime):,e.Graphics.DrawString(“建成年份:“ + this.建成年份DateTimePicker.Value.Year.ToString()+“年“, new Font(“宋体“, 20), Brushes.Black, 520, 190); e.Graphics.DrawLine(new Pen(Color.Black), 50, 220, 770, 220); e.Graphics.DrawString(“结构:“ + this.房TextBox.Text + “房“ + this.厅TextBox.Text + “厅“ + this.厨TextBox.Text + “厨“ + this.卫TextBox.Text + “卫“ + this.阳TextBox.Text + “阳台“, new Font(“宋体“, 20), Brushes.Black, 50, 240); e.Graphics.DrawString(“产权:“ + this.产权性质ComboBox.Text, new Font(“宋体“, 20), Brushes.Black, 390, 240); e.Graphics.DrawString(“土地:“ + this.土地性质ComboBox.Text, new Font(“宋体“, 20), Brushes.Black, 610, 240); 下面一些功能的实现 代码是一样的 这里还是不多做介绍了,如花美眷、似水流年,代码如下(Showtime):,private void 出售房源管理BindingNavigatorSaveItem_Click(object sender, EventArgs e) this.Validate(); this.出售房源管理BindingSource.EndEdit(); this.出售房源管理TableAdapter.Update(this.myHouseDataSet1.出售房源管理); private void 查询ToolStripButton_Click(object sender, EventArgs e) t

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论