📄 tsbb.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using System.Data;
namespace 中小型酒店管理信息系统
{
/// <summary>
/// tsbb 的摘要说明。
/// </summary>
public class tsbb : System.Windows.Forms.Form
{
CrystalReport2 crReportDocument;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Button button1;
private CrystalDecisions.Windows.Forms.CrystalReportViewer crystalReportViewer1;
private DataSet ds = new DataSet();
private LinkDataBase link = new LinkDataBase();
private DataSet ds2 = new DataSet();
private LinkDataBase link2 = new LinkDataBase();
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public tsbb()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// 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.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.crystalReportViewer1 = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.comboBox1);
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(720, 56);
this.panel1.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(400, 16);
this.button1.Name = "button1";
this.button1.TabIndex = 2;
this.button1.Text = "确定";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// comboBox1
//
this.comboBox1.Location = new System.Drawing.Point(208, 16);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(184, 20);
this.comboBox1.TabIndex = 1;
this.comboBox1.Text = "comboBox1";
//
// label1
//
this.label1.Location = new System.Drawing.Point(64, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(128, 16);
this.label1.TabIndex = 0;
this.label1.Text = "选择要打印的退宿编号";
//
// crystalReportViewer1
//
this.crystalReportViewer1.ActiveViewIndex = -1;
this.crystalReportViewer1.DisplayGroupTree = false;
this.crystalReportViewer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.crystalReportViewer1.Location = new System.Drawing.Point(0, 56);
this.crystalReportViewer1.Name = "crystalReportViewer1";
this.crystalReportViewer1.ReportSource = null;
this.crystalReportViewer1.Size = new System.Drawing.Size(720, 365);
this.crystalReportViewer1.TabIndex = 1;
//
// tsbb
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(720, 421);
this.Controls.Add(this.crystalReportViewer1);
this.Controls.Add(this.panel1);
this.Name = "tsbb";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "【退宿报表打印】";
this.Load += new System.EventHandler(this.tsbb_Load);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void tsbb_Load(object sender, System.EventArgs e)
{
scfjh();
}
private void scfjh() //生成退宿编号
{
string sendTableName = "jud_ts";
string sendStrSQL ="select pzhm from jud_ts ";
this.ds = this.link.SelectDataBase(sendStrSQL,sendTableName);
comboBox1.DataSource = ds.Tables[sendTableName];
comboBox1.DisplayMember = "pzhm";
}
private void button1_Click(object sender, System.EventArgs e)
{
string sendTableName = "jud_ts";
string sendStrSQL ="select * from jud_ts where pzhm='"+comboBox1.Text+"'";
this.ds2 = this.link2.SelectDataBase(sendStrSQL,sendTableName);
crReportDocument =new CrystalReport2();
crReportDocument.SetDataSource(ds2);
crystalReportViewer1.ReportSource = crReportDocument;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -