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

📄 frmdestine.cs

📁 实现房产销售的房屋管理 客户管理 并且在客户管理中实现了对预定客户和已购房客户的查询和修改
💻 CS
📖 第 1 页 / 共 2 页
字号:
			this.buttonX1.Size = new System.Drawing.Size(96, 24);
			this.buttonX1.TabIndex = 6;
			this.buttonX1.Text = " 确定";
			this.buttonX1.Click += new System.EventHandler(this.buttonX1_Click);
			// 
			// labelX4
			// 
			this.labelX4.Location = new System.Drawing.Point(520, 24);
			this.labelX4.Name = "labelX4";
			this.labelX4.Size = new System.Drawing.Size(75, 23);
			this.labelX4.TabIndex = 5;
			this.labelX4.Text = "员工姓名";
			// 
			// comboBoxEx1
			// 
			this.comboBoxEx1.DisplayMember = "Text";
			this.comboBoxEx1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
			this.comboBoxEx1.Location = new System.Drawing.Point(360, 24);
			this.comboBoxEx1.Name = "comboBoxEx1";
			this.comboBoxEx1.Size = new System.Drawing.Size(128, 22);
			this.comboBoxEx1.TabIndex = 3;
			// 
			// textBoxX1
			// 
			this.textBoxX1.AutoSize = false;
			// 
			// textBoxX1.Border
			// 
			this.textBoxX1.Border.Class = "TextBoxBorder";
			this.textBoxX1.Location = new System.Drawing.Point(112, 24);
			this.textBoxX1.Name = "textBoxX1";
			this.textBoxX1.Size = new System.Drawing.Size(100, 21);
			this.textBoxX1.TabIndex = 2;
			// 
			// labelX2
			// 
			this.labelX2.Location = new System.Drawing.Point(256, 24);
			this.labelX2.Name = "labelX2";
			this.labelX2.Size = new System.Drawing.Size(75, 23);
			this.labelX2.TabIndex = 1;
			this.labelX2.Text = "客户姓名";
			// 
			// labelX1
			// 
			this.labelX1.Location = new System.Drawing.Point(32, 24);
			this.labelX1.Name = "labelX1";
			this.labelX1.Size = new System.Drawing.Size(75, 23);
			this.labelX1.TabIndex = 0;
			this.labelX1.Text = "房屋编号";
			// 
			// panelEx2
			// 
			this.panelEx2.CanvasColor = System.Drawing.SystemColors.Control;
			this.panelEx2.Controls.Add(this.dataGrid1);
			this.panelEx2.Dock = System.Windows.Forms.DockStyle.Fill;
			this.panelEx2.Location = new System.Drawing.Point(0, 224);
			this.panelEx2.Name = "panelEx2";
			this.panelEx2.Size = new System.Drawing.Size(720, 221);
			this.panelEx2.Style.Alignment = System.Drawing.StringAlignment.Center;
			this.panelEx2.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;
			this.panelEx2.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2;
			this.panelEx2.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
			this.panelEx2.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText;
			this.panelEx2.Style.GradientAngle = 90;
			this.panelEx2.TabIndex = 3;
			// 
			// dataGrid1
			// 
			this.dataGrid1.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.dataGrid1.CaptionBackColor = System.Drawing.Color.LightSteelBlue;
			this.dataGrid1.CaptionForeColor = System.Drawing.Color.DodgerBlue;
			this.dataGrid1.DataMember = "";
			this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.dataGrid1.GridLineColor = System.Drawing.Color.Khaki;
			this.dataGrid1.HeaderBackColor = System.Drawing.SystemColors.ActiveCaptionText;
			this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid1.Location = new System.Drawing.Point(0, 0);
			this.dataGrid1.Name = "dataGrid1";
			this.dataGrid1.Size = new System.Drawing.Size(720, 221);
			this.dataGrid1.TabIndex = 0;
			// 
			// frmDestine
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(720, 445);
			this.Controls.Add(this.panelEx2);
			this.Controls.Add(this.panelEx1);
			this.Controls.Add(this.toolBar1);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.Name = "frmDestine";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "预定客户查询";
			this.Load += new System.EventHandler(this.frmDestine_Load);
			this.panelEx1.ResumeLayout(false);
			this.panelEx2.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
		{
			switch(this.toolBar1.Buttons.IndexOf(e.Button))
			{
				case 0:
					frmDestineClientFind fd=new frmDestineClientFind();
					fd.Owner=this;
					fd.ShowDialog();
					if(fd.name=="")
					{

					}
					else
					{
						string name=fd.name;
						this.ds=this._destineBS.getNameSelect(name);
						this.dataGrid1.DataSource=ds;
						this.dataGrid1.DataMember="DestineName";
					}
						break;//查询
				case 1:
					this.printPreviewDialog1.ShowDialog();
					break;//
				case 2:
					this.Close();
					break;
			}
		}

		

		private void printDocument1_PrintPage_1(object sender, System.Drawing.Printing.PrintPageEventArgs e)
		{
			System.Drawing.Font objFont = new System.Drawing.Font("宋体",11,FontStyle.Underline);
			Brush objBrush = Brushes.Black;
			Pen objPen = new Pen(objBrush);
			objPen.Width = 2;
			
			//向打印预缆窗口中添加内容
			
			int nLeft = this.pageSetupDialog1.PageSettings.Margins.Left;
			int nTop = this.pageSetupDialog1.PageSettings.Margins.Top;
			int nWidth = this.pageSetupDialog1.PageSettings.PaperSize.Width-
				(this.pageSetupDialog1.PageSettings.Margins.Left + 
				this.pageSetupDialog1.PageSettings.Margins.Right);
			int nHeight = this.pageSetupDialog1.PageSettings.PaperSize.Height-
				(this.pageSetupDialog1.PageSettings.Margins.Top + 
				this.pageSetupDialog1.PageSettings.Margins.Bottom);
			
			
			//打印出表头
			
			e.Graphics.DrawString("订购信息",new System.Drawing.Font("Garamond",40,FontStyle.Bold),Brushes.Blue,nLeft+200,nTop+10);
			e.Graphics.DrawString("客户姓名",objFont,objBrush,nLeft+10,nTop+60);
			e.Graphics.DrawString("面积",objFont,objBrush,nLeft+100,nTop+60);
			e.Graphics.DrawString("层数",objFont,objBrush,nLeft+180,nTop+60);
			e.Graphics.DrawString("规格",objFont,objBrush,nLeft+300,nTop+60);
			e.Graphics.DrawString("朝向",objFont,objBrush,nLeft+420,nTop+60);
			e.Graphics.DrawString("客户电话",objFont,objBrush,nLeft+500,nTop+60);
			e.Graphics.DrawString("状态",objFont,objBrush,nLeft+600,nTop+60);
		
			//打印具体数据
			
			try
			{
				HouseBS.DestineBS employee=new  DestineBS();
				this.ds=employee.select();
				int nLine=1;
				foreach( DataRow rows in this.ds.Tables[0].Rows)
				{
					e.Graphics.DrawString(rows[0].ToString(),objFont,objBrush,nLeft+10,nTop+60+nLine*30);
					e.Graphics.DrawString(rows[1].ToString(),objFont,objBrush,nLeft+100,nTop+60+nLine*30);
					e.Graphics.DrawString(rows[2].ToString(),objFont,objBrush,nLeft+180,nTop+60+nLine*30);
					e.Graphics.DrawString(rows[3].ToString(),objFont,objBrush,nLeft+300,nTop+60+nLine*30);
					e.Graphics.DrawString(rows[4].ToString(),objFont,objBrush,nLeft+420,nTop+60+nLine*30);
					e.Graphics.DrawString(rows[5].ToString(),objFont,objBrush,nLeft+500,nTop+60+nLine*30);
					e.Graphics.DrawString(rows[6].ToString(),objFont,objBrush,nLeft+600,nTop+60+nLine*30);
					nLine++;
				}
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}

		private void frmDestine_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());
			}
		    this.ds=new DataSet();
			this.ds=this._destineBS.select();
			this.dataGrid1.DataSource=this.ds;
			this.dataGrid1.DataMember="Destine";
		}

		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)
			{
                MessageBox.Show("请把信息填写完整");
				return;
			}
			try
			{
				HouseBS.HomeBS homes=new HomeBS();
				homes.Sale(this.comboBoxEx2.Text,this.textBoxX1.Text,this.comboBoxEx1.Text);
			}
			catch(Exception ex)
			{
			  MessageBox.Show(ex.Message);
			}
            MessageBox.Show("操作成功!");
		    //清空文本框
			this.textBoxX1.Text="";
			this.textBoxX3.Text="";
			this.comboBoxEx1.Text="";
			this.comboBoxEx2.Text="";
		}
	}
}

⌨️ 快捷键说明

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