⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmsale.cs

📁 实现房产销售的房屋管理 客户管理 并且在客户管理中实现了对预定客户和已购房客户的查询和修改
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using HouseBE;
using HouseBS;
using System.Data;

namespace frmLogin
{
	/// <summary>
	/// frmSale 的摘要说明。
	/// </summary>
	public class frmSale : System.Windows.Forms.Form
	{
		private DevComponents.DotNetBar.LabelX labelX1;
		private DevComponents.DotNetBar.Controls.TextBoxX textBoxX1;
		private DevComponents.DotNetBar.PanelEx panelEx1;
		private DevComponents.DotNetBar.Controls.ComboBoxEx comboBoxEx1;
		private DevComponents.DotNetBar.LabelX labelX2;
		private DevComponents.DotNetBar.LabelX labelX3;
		private DevComponents.DotNetBar.Controls.TextBoxX textBoxX2;
		private DevComponents.DotNetBar.LabelX labelX4;
		private DevComponents.DotNetBar.LabelX labelX5;
		private DevComponents.DotNetBar.Controls.ComboBoxEx comboBoxEx2;
		private DevComponents.DotNetBar.ButtonX buttonX1;
		private DevComponents.DotNetBar.LabelX labelX6;
		private DevComponents.DotNetBar.Controls.TextBoxX textBoxX4;
		private DevComponents.DotNetBar.LabelX labelX7;
		private System.Windows.Forms.DateTimePicker dateTimePicker1;
		private DevComponents.DotNetBar.LabelX labelX8;
		private DevComponents.DotNetBar.Controls.TextBoxX textBoxX5;
		private DevComponents.DotNetBar.ButtonX buttonX2;
		private DevComponents.DotNetBar.Controls.ComboBoxEx comboBoxEx3;
		private DevComponents.Editors.ComboItem comboItem1;
		private DevComponents.Editors.ComboItem comboItem2;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public frmSale()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}
		public frmSale(string HomeID)
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
			this.textBoxX1.Text=HomeID;
			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}
		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.labelX1 = new DevComponents.DotNetBar.LabelX();
			this.textBoxX1 = new DevComponents.DotNetBar.Controls.TextBoxX();
			this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
			this.comboBoxEx3 = new DevComponents.DotNetBar.Controls.ComboBoxEx();
			this.comboItem1 = new DevComponents.Editors.ComboItem();
			this.comboItem2 = new DevComponents.Editors.ComboItem();
			this.buttonX2 = new DevComponents.DotNetBar.ButtonX();
			this.textBoxX5 = new DevComponents.DotNetBar.Controls.TextBoxX();
			this.labelX8 = new DevComponents.DotNetBar.LabelX();
			this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
			this.labelX7 = new DevComponents.DotNetBar.LabelX();
			this.textBoxX4 = new DevComponents.DotNetBar.Controls.TextBoxX();
			this.labelX6 = new DevComponents.DotNetBar.LabelX();
			this.buttonX1 = new DevComponents.DotNetBar.ButtonX();
			this.comboBoxEx2 = new DevComponents.DotNetBar.Controls.ComboBoxEx();
			this.labelX5 = new DevComponents.DotNetBar.LabelX();
			this.labelX4 = new DevComponents.DotNetBar.LabelX();
			this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX();
			this.labelX3 = new DevComponents.DotNetBar.LabelX();
			this.labelX2 = new DevComponents.DotNetBar.LabelX();
			this.comboBoxEx1 = new DevComponents.DotNetBar.Controls.ComboBoxEx();
			this.panelEx1.SuspendLayout();
			this.SuspendLayout();
			// 
			// labelX1
			// 
			this.labelX1.Location = new System.Drawing.Point(8, 24);
			this.labelX1.Name = "labelX1";
			this.labelX1.Size = new System.Drawing.Size(75, 23);
			this.labelX1.TabIndex = 0;
			this.labelX1.Text = "房屋编号";
			// 
			// textBoxX1
			// 
			this.textBoxX1.AutoSize = false;
			// 
			// textBoxX1.Border
			// 
			this.textBoxX1.Border.Class = "TextBoxBorder";
			this.textBoxX1.Location = new System.Drawing.Point(104, 24);
			this.textBoxX1.Name = "textBoxX1";
			this.textBoxX1.Size = new System.Drawing.Size(100, 21);
			this.textBoxX1.TabIndex = 1;
			// 
			// panelEx1
			// 
			this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control;
			this.panelEx1.Controls.Add(this.comboBoxEx3);
			this.panelEx1.Controls.Add(this.buttonX2);
			this.panelEx1.Controls.Add(this.textBoxX5);
			this.panelEx1.Controls.Add(this.labelX8);
			this.panelEx1.Controls.Add(this.dateTimePicker1);
			this.panelEx1.Controls.Add(this.labelX7);
			this.panelEx1.Controls.Add(this.textBoxX4);
			this.panelEx1.Controls.Add(this.labelX6);
			this.panelEx1.Controls.Add(this.buttonX1);
			this.panelEx1.Controls.Add(this.comboBoxEx2);
			this.panelEx1.Controls.Add(this.labelX5);
			this.panelEx1.Controls.Add(this.labelX4);
			this.panelEx1.Controls.Add(this.textBoxX2);
			this.panelEx1.Controls.Add(this.labelX3);
			this.panelEx1.Controls.Add(this.labelX2);
			this.panelEx1.Controls.Add(this.comboBoxEx1);
			this.panelEx1.Controls.Add(this.textBoxX1);
			this.panelEx1.Controls.Add(this.labelX1);
			this.panelEx1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.panelEx1.Location = new System.Drawing.Point(0, 0);
			this.panelEx1.Name = "panelEx1";
			this.panelEx1.Size = new System.Drawing.Size(480, 293);
			this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;
			this.panelEx1.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
			this.panelEx1.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2;
			this.panelEx1.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
			this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
			this.panelEx1.Style.GradientAngle = 90;
			this.panelEx1.TabIndex = 2;
			// 
			// comboBoxEx3
			// 
			this.comboBoxEx3.DisplayMember = "Text";
			this.comboBoxEx3.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
			this.comboBoxEx3.Items.AddRange(new object[] {
															 this.comboItem1,
															 this.comboItem2});
			this.comboBoxEx3.Location = new System.Drawing.Point(368, 72);
			this.comboBoxEx3.Name = "comboBoxEx3";
			this.comboBoxEx3.Size = new System.Drawing.Size(96, 22);
			this.comboBoxEx3.TabIndex = 18;
			// 
			// comboItem1
			// 
			this.comboItem1.Text = "一次性";
			// 
			// comboItem2
			// 
			this.comboItem2.Text = "分期付款";
			// 
			// buttonX2
			// 
			this.buttonX2.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
			this.buttonX2.Location = new System.Drawing.Point(136, 216);
			this.buttonX2.Name = "buttonX2";
			this.buttonX2.Size = new System.Drawing.Size(96, 64);
			this.buttonX2.TabIndex = 17;
			this.buttonX2.Text = "<b>取 消</b>";
			this.buttonX2.Click += new System.EventHandler(this.buttonX2_Click);
			// 
			// textBoxX5
			// 
			this.textBoxX5.AutoSize = false;
			// 
			// textBoxX5.Border
			// 
			this.textBoxX5.Border.Class = "TextBoxBorder";
			this.textBoxX5.Location = new System.Drawing.Point(256, 208);
			this.textBoxX5.Name = "textBoxX5";
			this.textBoxX5.Size = new System.Drawing.Size(216, 80);
			this.textBoxX5.TabIndex = 16;
			// 
			// labelX8
			// 
			this.labelX8.Location = new System.Drawing.Point(256, 176);
			this.labelX8.Name = "labelX8";
			this.labelX8.Size = new System.Drawing.Size(160, 24);
			this.labelX8.TabIndex = 15;
			this.labelX8.Text = "备注信息 (可以不填写)";
			// 
			// dateTimePicker1
			// 
			this.dateTimePicker1.Location = new System.Drawing.Point(104, 176);
			this.dateTimePicker1.Name = "dateTimePicker1";
			this.dateTimePicker1.Size = new System.Drawing.Size(120, 21);
			this.dateTimePicker1.TabIndex = 14;
			// 
			// labelX7
			// 
			this.labelX7.Location = new System.Drawing.Point(8, 176);
			this.labelX7.Name = "labelX7";
			this.labelX7.Size = new System.Drawing.Size(75, 23);
			this.labelX7.TabIndex = 13;
			this.labelX7.Text = "交易时间";
			// 
			// textBoxX4
			// 
			this.textBoxX4.AutoSize = false;
			// 
			// textBoxX4.Border
			// 
			this.textBoxX4.Border.Class = "TextBoxBorder";
			this.textBoxX4.Location = new System.Drawing.Point(368, 128);
			this.textBoxX4.Name = "textBoxX4";
			this.textBoxX4.Size = new System.Drawing.Size(100, 21);
			this.textBoxX4.TabIndex = 12;
			// 
			// labelX6
			// 
			this.labelX6.Location = new System.Drawing.Point(256, 128);
			this.labelX6.Name = "labelX6";
			this.labelX6.Size = new System.Drawing.Size(75, 23);
			this.labelX6.TabIndex = 11;
			this.labelX6.Text = "交易金额";
			// 
			// buttonX1
			// 
			this.buttonX1.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
			this.buttonX1.Location = new System.Drawing.Point(16, 216);
			this.buttonX1.Name = "buttonX1";
			this.buttonX1.Size = new System.Drawing.Size(96, 64);
			this.buttonX1.TabIndex = 10;
			this.buttonX1.Text = "<b>销  售</b>";
			this.buttonX1.Click += new System.EventHandler(this.buttonX1_Click);
			// 
			// comboBoxEx2
			// 
			this.comboBoxEx2.DisplayMember = "Text";
			this.comboBoxEx2.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
			this.comboBoxEx2.Location = new System.Drawing.Point(104, 128);
			this.comboBoxEx2.Name = "comboBoxEx2";
			this.comboBoxEx2.Size = new System.Drawing.Size(104, 22);
			this.comboBoxEx2.TabIndex = 9;
			// 
			// labelX5
			// 
			this.labelX5.Location = new System.Drawing.Point(8, 128);
			this.labelX5.Name = "labelX5";
			this.labelX5.Size = new System.Drawing.Size(75, 23);
			this.labelX5.TabIndex = 8;
			this.labelX5.Text = "销售员工";
			// 
			// labelX4
			// 
			this.labelX4.Location = new System.Drawing.Point(256, 72);
			this.labelX4.Name = "labelX4";
			this.labelX4.Size = new System.Drawing.Size(75, 23);
			this.labelX4.TabIndex = 6;
			this.labelX4.Text = "支付方式";
			// 
			// textBoxX2
			// 
			this.textBoxX2.AutoSize = false;
			// 
			// textBoxX2.Border
			// 
			this.textBoxX2.Border.Class = "TextBoxBorder";
			this.textBoxX2.Location = new System.Drawing.Point(368, 24);
			this.textBoxX2.Name = "textBoxX2";
			this.textBoxX2.Size = new System.Drawing.Size(100, 21);
			this.textBoxX2.TabIndex = 5;
			// 
			// labelX3
			// 
			this.labelX3.Location = new System.Drawing.Point(256, 24);
			this.labelX3.Name = "labelX3";
			this.labelX3.Size = new System.Drawing.Size(75, 23);
			this.labelX3.TabIndex = 4;
			this.labelX3.Text = "合同编号";
			// 
			// labelX2
			// 
			this.labelX2.Location = new System.Drawing.Point(8, 72);
			this.labelX2.Name = "labelX2";
			this.labelX2.Size = new System.Drawing.Size(75, 23);
			this.labelX2.TabIndex = 3;
			this.labelX2.Text = "客户姓名";
			// 
			// comboBoxEx1
			// 
			this.comboBoxEx1.DisplayMember = "Text";
			this.comboBoxEx1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
			this.comboBoxEx1.Location = new System.Drawing.Point(104, 72);
			this.comboBoxEx1.Name = "comboBoxEx1";
			this.comboBoxEx1.Size = new System.Drawing.Size(104, 22);
			this.comboBoxEx1.TabIndex = 2;
			// 
			// frmSale
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(480, 293);
			this.Controls.Add(this.panelEx1);
			this.Name = "frmSale";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "房屋销售";
			this.Load += new System.EventHandler(this.frmSale_Load);
			this.panelEx1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		private void frmSale_Load(object sender, System.EventArgs e)
		{
			HouseBS.ClientBS client=new ClientBS();
			DataSet ds1=new DataSet();
			ds1=client.select();
			foreach(DataRow row in ds1.Tables[0].Rows)
			{
				this.comboBoxEx1.Items.Add(row[0].ToString());
			}
			//加载员工信息
			HouseBS.EmployeeBS employee=new EmployeeBS();
			DataSet ds2=new DataSet();
			ds2=employee.select();
			foreach(DataRow row in ds2.Tables[0].Rows)
			{
				this.comboBoxEx2.Items.Add(row[0].ToString());
			}
		}

		private void buttonX2_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void buttonX1_Click(object sender, System.EventArgs e)
		{
			if(this.textBoxX1.Text.Length<1||this.textBoxX2.Text.Length<1||this.textBoxX4.Text.Length<1||this.comboBoxEx1.Text.Length<1||this.comboBoxEx2.Text.Length<1||this.comboBoxEx3.Text.Length<1)
			{
				MessageBox.Show("请把信息填写完整!");
				return;
			}
			HouseBS.HomeBS home=new HomeBS();
			try
			{
				home.SaleHouse(this.comboBoxEx2.Text,this.comboBoxEx1.Text,this.textBoxX2.Text,this.comboBoxEx3.Text,this.dateTimePicker1.Value.ToString(),this.textBoxX4.Text,this.textBoxX1.Text);
				MessageBox.Show("操作成功!");
				this.textBoxX1.Text="";
				this.textBoxX2.Text="";
				this.textBoxX4.Text="";
				this.textBoxX5.Text="";
				this.comboBoxEx1.Text="";
				this.comboBoxEx2.Text="";
				this.comboBoxEx3.Text="";
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -