📄 统计信息.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
namespace 机房计费系统
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class frmStatistic : System.Windows.Forms.Form
{
private String sql;
private String sql1;
private String sql2;
private String sql3;
private String sql4;
private String sql5;
private String sql6;
private string str1;
private string str2;
private string str_teacher;
private string str_starttime;
private string str_endtime;
private string str6;
private string str7;
private int daynumber;
private decimal sum;
private System.Data.SqlClient.SqlConnection sqlConnection1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox textBox7;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.DateTimePicker dateTimePicker2;
private System.Windows.Forms.DateTimePicker dateTimePicker1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.DateTimePicker dateTimePicker3;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.DateTimePicker dateTimePicker4;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.TextBox textBox8;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.TextBox textBox9;
private System.Windows.Forms.Button button1;
private System.Data.DataTable dataTable1;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
private System.Data.SqlClient.SqlConnection sqlConnection2;
//private 机房计费系统.DataSet1 dataSet11;
private DataSet sds=new DataSet();
private DataView dvZh;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public frmStatistic()
{
//
// 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.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox7 = new System.Windows.Forms.TextBox();
this.textBox6 = new System.Windows.Forms.TextBox();
this.label16 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker();
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label8 = new System.Windows.Forms.Label();
this.textBox4 = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.button1 = new System.Windows.Forms.Button();
this.textBox9 = new System.Windows.Forms.TextBox();
this.label18 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.textBox8 = new System.Windows.Forms.TextBox();
this.label15 = new System.Windows.Forms.Label();
this.dateTimePicker4 = new System.Windows.Forms.DateTimePicker();
this.label13 = new System.Windows.Forms.Label();
this.textBox5 = new System.Windows.Forms.TextBox();
this.dateTimePicker3 = new System.Windows.Forms.DateTimePicker();
this.label12 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label11 = new System.Windows.Forms.Label();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlConnection2 = new System.Data.SqlClient.SqlConnection();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "workstation id=XU;packet size=4096;integrated security=SSPI;data source=XU;persis" +
"t security info=False;initial catalog=jifei";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textBox7);
this.groupBox1.Controls.Add(this.textBox6);
this.groupBox1.Controls.Add(this.label16);
this.groupBox1.Controls.Add(this.label14);
this.groupBox1.Controls.Add(this.button2);
this.groupBox1.Controls.Add(this.label10);
this.groupBox1.Controls.Add(this.label9);
this.groupBox1.Controls.Add(this.dateTimePicker2);
this.groupBox1.Controls.Add(this.dateTimePicker1);
this.groupBox1.Font = new System.Drawing.Font("宋体", 10F);
this.groupBox1.Location = new System.Drawing.Point(24, 124);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(540, 112);
this.groupBox1.TabIndex = 29;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "上机率统计";
//
// textBox7
//
this.textBox7.Enabled = false;
this.textBox7.Location = new System.Drawing.Point(396, 75);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(126, 23);
this.textBox7.TabIndex = 37;
this.textBox7.Text = "";
//
// textBox6
//
this.textBox6.Enabled = false;
this.textBox6.Location = new System.Drawing.Point(135, 75);
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(132, 23);
this.textBox6.TabIndex = 36;
this.textBox6.Text = "";
//
// label16
//
this.label16.Font = new System.Drawing.Font("宋体", 12F);
this.label16.Location = new System.Drawing.Point(282, 75);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(123, 18);
this.label16.TabIndex = 35;
this.label16.Text = "515室上机率为:";
//
// label14
//
this.label14.Font = new System.Drawing.Font("宋体", 12F);
this.label14.Location = new System.Drawing.Point(21, 75);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(126, 18);
this.label14.TabIndex = 34;
this.label14.Text = "615室上机率为:";
//
// button2
//
this.button2.Font = new System.Drawing.Font("宋体", 10F);
this.button2.Location = new System.Drawing.Point(375, 31);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(84, 25);
this.button2.TabIndex = 33;
this.button2.Text = "计算上机率";
this.button2.Click += new System.EventHandler(this.button2_Click_1);
//
// label10
//
this.label10.Font = new System.Drawing.Font("宋体", 12F);
this.label10.Location = new System.Drawing.Point(21, 31);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(84, 19);
this.label10.TabIndex = 32;
this.label10.Text = "统计日期从";
//
// label9
//
this.label9.Font = new System.Drawing.Font("宋体", 12F);
this.label9.Location = new System.Drawing.Point(219, 31);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(30, 19);
this.label9.TabIndex = 31;
this.label9.Text = "至";
//
// dateTimePicker2
//
this.dateTimePicker2.Location = new System.Drawing.Point(255, 31);
this.dateTimePicker2.Name = "dateTimePicker2";
this.dateTimePicker2.Size = new System.Drawing.Size(108, 23);
this.dateTimePicker2.TabIndex = 30;
//
// dateTimePicker1
//
this.dateTimePicker1.Location = new System.Drawing.Point(105, 31);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(108, 23);
this.dateTimePicker1.TabIndex = 29;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.label8);
this.groupBox2.Controls.Add(this.textBox4);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.textBox3);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.textBox2);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.textBox1);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Font = new System.Drawing.Font("宋体", 10F);
this.groupBox2.Location = new System.Drawing.Point(24, 19);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(540, 93);
this.groupBox2.TabIndex = 30;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "上机人数统计";
//
// label8
//
this.label8.Font = new System.Drawing.Font("宋体", 12F);
this.label8.Location = new System.Drawing.Point(465, 59);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(54, 19);
this.label8.TabIndex = 23;
this.label8.Text = "人";
//
// textBox4
//
this.textBox4.Enabled = false;
this.textBox4.Location = new System.Drawing.Point(351, 59);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(108, 23);
this.textBox4.TabIndex = 22;
this.textBox4.Text = "";
//
// label7
//
this.label7.Font = new System.Drawing.Font("宋体", 12F);
this.label7.Location = new System.Drawing.Point(291, 59);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(54, 19);
this.label7.TabIndex = 21;
this.label7.Text = "515有";
//
// label6
//
this.label6.Font = new System.Drawing.Font("宋体", 12F);
this.label6.Location = new System.Drawing.Point(465, 22);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(54, 25);
this.label6.TabIndex = 20;
this.label6.Text = "人";
//
// textBox3
//
this.textBox3.Enabled = false;
this.textBox3.Location = new System.Drawing.Point(351, 22);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(108, 23);
this.textBox3.TabIndex = 19;
this.textBox3.Text = "";
//
// label5
//
this.label5.Font = new System.Drawing.Font("宋体", 12F);
this.label5.Location = new System.Drawing.Point(261, 22);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -