📄 统计信息.cs
字号:
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(90, 18);
this.label5.TabIndex = 18;
this.label5.Text = "其中615有";
//
// label4
//
this.label4.Font = new System.Drawing.Font("宋体", 12F);
this.label4.Location = new System.Drawing.Point(219, 59);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(48, 25);
this.label4.TabIndex = 17;
this.label4.Text = "元";
//
// textBox2
//
this.textBox2.Enabled = false;
this.textBox2.Location = new System.Drawing.Point(105, 59);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(108, 23);
this.textBox2.TabIndex = 16;
this.textBox2.Text = "";
//
// label3
//
this.label3.Font = new System.Drawing.Font("宋体", 12F);
this.label3.Location = new System.Drawing.Point(15, 59);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(90, 25);
this.label3.TabIndex = 15;
this.label3.Text = "目前共收费";
//
// textBox1
//
this.textBox1.Enabled = false;
this.textBox1.Location = new System.Drawing.Point(105, 22);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(108, 23);
this.textBox1.TabIndex = 14;
this.textBox1.Text = "";
//
// label2
//
this.label2.Font = new System.Drawing.Font("宋体", 12F);
this.label2.Location = new System.Drawing.Point(219, 22);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(48, 25);
this.label2.TabIndex = 13;
this.label2.Text = "人";
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 12F);
this.label1.Location = new System.Drawing.Point(15, 22);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(108, 18);
this.label1.TabIndex = 12;
this.label1.Text = "目前共上机";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.button1);
this.groupBox3.Controls.Add(this.textBox9);
this.groupBox3.Controls.Add(this.label18);
this.groupBox3.Controls.Add(this.label17);
this.groupBox3.Controls.Add(this.textBox8);
this.groupBox3.Controls.Add(this.label15);
this.groupBox3.Controls.Add(this.dateTimePicker4);
this.groupBox3.Controls.Add(this.label13);
this.groupBox3.Controls.Add(this.textBox5);
this.groupBox3.Controls.Add(this.dateTimePicker3);
this.groupBox3.Controls.Add(this.label12);
this.groupBox3.Controls.Add(this.comboBox1);
this.groupBox3.Controls.Add(this.label11);
this.groupBox3.Font = new System.Drawing.Font("宋体", 10F);
this.groupBox3.Location = new System.Drawing.Point(24, 249);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(540, 155);
this.groupBox3.TabIndex = 31;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "教师费用统计";
//
// button1
//
this.button1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.button1.Location = new System.Drawing.Point(450, 106);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(60, 25);
this.button1.TabIndex = 12;
this.button1.Text = "统计";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox9
//
this.textBox9.Enabled = false;
this.textBox9.Location = new System.Drawing.Point(132, 112);
this.textBox9.Name = "textBox9";
this.textBox9.Size = new System.Drawing.Size(96, 23);
this.textBox9.TabIndex = 11;
this.textBox9.Text = "";
//
// label18
//
this.label18.Font = new System.Drawing.Font("宋体", 12F);
this.label18.Location = new System.Drawing.Point(18, 112);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(114, 19);
this.label18.TabIndex = 10;
this.label18.Text = "共收入费用为:";
//
// label17
//
this.label17.Font = new System.Drawing.Font("宋体", 12F);
this.label17.Location = new System.Drawing.Point(516, 68);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(18, 19);
this.label17.TabIndex = 9;
this.label17.Text = "时";
//
// textBox8
//
this.textBox8.Location = new System.Drawing.Point(450, 68);
this.textBox8.Name = "textBox8";
this.textBox8.Size = new System.Drawing.Size(60, 23);
this.textBox8.TabIndex = 8;
this.textBox8.Text = "23";
//
// label15
//
this.label15.Font = new System.Drawing.Font("宋体", 12F);
this.label15.Location = new System.Drawing.Point(300, 68);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(24, 19);
this.label15.TabIndex = 7;
this.label15.Text = "到";
//
// dateTimePicker4
//
this.dateTimePicker4.Location = new System.Drawing.Point(330, 68);
this.dateTimePicker4.Name = "dateTimePicker4";
this.dateTimePicker4.Size = new System.Drawing.Size(114, 23);
this.dateTimePicker4.TabIndex = 6;
//
// label13
//
this.label13.Font = new System.Drawing.Font("宋体", 12F);
this.label13.Location = new System.Drawing.Point(282, 68);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(36, 19);
this.label13.TabIndex = 5;
this.label13.Text = "时";
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(234, 68);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(48, 23);
this.textBox5.TabIndex = 4;
this.textBox5.Text = "7";
//
// dateTimePicker3
//
this.dateTimePicker3.Location = new System.Drawing.Point(114, 68);
this.dateTimePicker3.Name = "dateTimePicker3";
this.dateTimePicker3.Size = new System.Drawing.Size(114, 23);
this.dateTimePicker3.TabIndex = 3;
//
// label12
//
this.label12.Font = new System.Drawing.Font("宋体", 12F);
this.label12.Location = new System.Drawing.Point(18, 68);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(90, 19);
this.label12.TabIndex = 2;
this.label12.Text = "统计时间从";
//
// comboBox1
//
this.comboBox1.Location = new System.Drawing.Point(102, 31);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(126, 21);
this.comboBox1.TabIndex = 1;
//
// label11
//
this.label11.Font = new System.Drawing.Font("宋体", 12F);
this.label11.Location = new System.Drawing.Point(18, 31);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(84, 19);
this.label11.TabIndex = 0;
this.label11.Text = "教师姓名:";
//
// sqlDataAdapter1
//
this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "操作员表", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("姓名", "姓名")})});
//
// sqlInsertCommand1
//
this.sqlInsertCommand1.CommandText = "INSERT INTO 操作员表(姓名) VALUES (@姓名); SELECT 姓名 FROM 操作员表";
this.sqlInsertCommand1.Connection = this.sqlConnection2;
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@姓名", System.Data.SqlDbType.VarChar, 50, "姓名"));
//
// sqlConnection2
//
this.sqlConnection2.ConnectionString = "workstation id=XU;packet size=4096;integrated security=SSPI;data source=XU;persis" +
"t security info=False;initial catalog=jifei";
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "SELECT 姓名 FROM 操作员表";
this.sqlSelectCommand1.Connection = this.sqlConnection2;
//
// frmStatistic
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(594, 423);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "frmStatistic";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "统计信息";
this.Load += new System.EventHandler(this.frmStatistic_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
}
private void frmStatistic_Load(object sender, System.EventArgs e)
{
//总上机人数
sql="select count(*) from 流水帐表 where 上机状态='1'";
SqlCommand cmd=new SqlCommand(sql,this.sqlConnection1);
this.sqlConnection1.Open();
SqlDataReader reader=cmd.ExecuteReader();
try
{
if(reader.Read())
{
this.textBox1.Text=reader.GetSqlInt32(0).ToString();
}
else
{
reader.Close();
this.sqlConnection1.Close();
}
}
catch(SqlNullValueException exe)
{
reader.Close();
this.sqlConnection1.Close();
goto Finish;
}
catch(SqlException exe)
{
reader.Close();
this.sqlConnection1.Close();
goto Finish;
}
finally
{
reader.Close();
this.sqlConnection1.Close();
}
//A区上机人数
sql1="select count(*) from 流水帐表 where 上机状态='1' and 上机区域='615'";
SqlCommand cmd1=new SqlCommand(sql1,this.sqlConnection1);
this.sqlConnection1.Open();
SqlDataReader reader1=cmd1.ExecuteReader();
try
{
if(reader1.Read())
{
this.textBox3.Text=reader1.GetSqlInt32(0).ToString();
}
else
{
reader1.Close();
this.sqlConnection1.Close();
}
}
catch(SqlNullValueException exe)
{
reader1.Close();
this.sqlConnection1.Close();
goto Finish;
}
catch(SqlException exe)
{
reader1.Close();
this.sqlConnection1.Close();
goto Finish;
}
finally
{
reader1.Close();
this.sqlConnection1.Close();
}
//B区上机人数
sql2="select count(*) from 流水帐表 where 上机状态='1' and 上机区域='515'";
SqlCommand cmd2=new SqlCommand(sql2,this.sqlConnection1);
this.sqlConnection1.Open();
SqlDataReader reader2=cmd2.ExecuteReader();
try
{
if(reader2.Read())
{
this.textBox4.Text=reader2.GetSqlInt32(0).ToString();
}
else
{
reader2.Close();
this.sqlConnection1.Close();
}
}
catch(SqlNullValueException exe)
{
reader2.Close();
this.sqlConnection1.Close();
goto Finish;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -