?? 收費(fèi)管理.cs
字號(hào):
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 機(jī)房計(jì)費(fèi)系統(tǒng)
{
/// <summary>
/// 收費(fèi)管理 的摘要說(shuō)明。
/// </summary>
public class 收費(fèi)管理 : System.Windows.Forms.Form
{
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.DataGrid dataGrid3;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter3;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
private System.Data.SqlClient.SqlConnection sqlConnection1;
private DataSet sds=new DataSet();
private System.Windows.Forms.Button button1;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
private System.Data.SqlClient.SqlCommand sqlSelectCommand2;
private System.Data.SqlClient.SqlCommand sqlInsertCommand2;
private System.Data.SqlClient.SqlCommand sqlUpdateCommand2;
private System.Data.SqlClient.SqlCommand sqlDeleteCommand2;
/// <summary>
/// 必需的設(shè)計(jì)器變量。
/// </summary>
private System.ComponentModel.Container components = null;
public 收費(fèi)管理()
{
//
// Windows 窗體設(shè)計(jì)器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 調(diào)用后添加任何構(gòu)造函數(shù)代碼
//
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗體設(shè)計(jì)器生成的代碼
/// <summary>
/// 設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
this.dataGrid3 = new System.Windows.Forms.DataGrid();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.sqlDataAdapter3 = new System.Data.SqlClient.SqlDataAdapter();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
this.button1 = new System.Windows.Forms.Button();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.sqlDeleteCommand2 = new System.Data.SqlClient.SqlCommand();
this.sqlInsertCommand2 = new System.Data.SqlClient.SqlCommand();
this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand2 = new System.Data.SqlClient.SqlCommand();
((System.ComponentModel.ISupportInitialize)(this.dataGrid3)).BeginInit();
this.SuspendLayout();
//
// dataGrid3
//
this.dataGrid3.CaptionText = "收費(fèi)明細(xì)";
this.dataGrid3.DataMember = "";
this.dataGrid3.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid3.Location = new System.Drawing.Point(24, 32);
this.dataGrid3.Name = "dataGrid3";
this.dataGrid3.Size = new System.Drawing.Size(648, 328);
this.dataGrid3.TabIndex = 0;
//
// comboBox1
//
this.comboBox1.Font = new System.Drawing.Font("宋體", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.comboBox1.Location = new System.Drawing.Point(144, 376);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(136, 24);
this.comboBox1.TabIndex = 1;
this.comboBox1.Click += new System.EventHandler(this.comboBox1_Click);
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋體", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.Location = new System.Drawing.Point(40, 376);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(80, 23);
this.label1.TabIndex = 2;
this.label1.Text = "值班教師";
this.label1.TextAlign = System.Drawing.ContentAlignment.BottomRight;
//
// sqlDataAdapter3
//
this.sqlDataAdapter3.DeleteCommand = this.sqlDeleteCommand1;
this.sqlDataAdapter3.InsertCommand = this.sqlInsertCommand1;
this.sqlDataAdapter3.SelectCommand = this.sqlSelectCommand1;
this.sqlDataAdapter3.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "收費(fèi)流水表", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("ID", "ID"),
new System.Data.Common.DataColumnMapping("時(shí)間", "時(shí)間"),
new System.Data.Common.DataColumnMapping("條形碼", "條形碼"),
new System.Data.Common.DataColumnMapping("值班教師", "值班教師"),
new System.Data.Common.DataColumnMapping("收費(fèi)", "收費(fèi)"),
new System.Data.Common.DataColumnMapping("充值", "充值")})});
this.sqlDataAdapter3.UpdateCommand = this.sqlUpdateCommand1;
//
// sqlDeleteCommand1
//
this.sqlDeleteCommand1.CommandText = @"DELETE FROM 收費(fèi)流水表 WHERE (ID = @Original_ID) AND (值班教師 = @Original_值班教師 OR @Original_值班教師 IS NULL AND 值班教師 IS NULL) AND (充值 = @Original_充值 OR @Original_充值 IS NULL AND 充值 IS NULL) AND (收費(fèi) = @Original_收費(fèi) OR @Original_收費(fèi) IS NULL AND 收費(fèi) IS NULL) AND (時(shí)間 = @Original_時(shí)間 OR @Original_時(shí)間 IS NULL AND 時(shí)間 IS NULL) AND (條形碼 = @Original_條形碼 OR @Original_條形碼 IS NULL AND 條形碼 IS NULL)";
this.sqlDeleteCommand1.Connection = this.sqlConnection1;
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.BigInt, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_值班教師", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "值班教師", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_充值", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, false, ((System.Byte)(5)), ((System.Byte)(2)), "充值", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_收費(fèi)", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, false, ((System.Byte)(5)), ((System.Byte)(2)), "收費(fèi)", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_時(shí)間", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "時(shí)間", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_條形碼", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "條形碼", System.Data.DataRowVersion.Original, null));
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "workstation id=XU;packet size=4096;integrated security=SSPI;data source=XU;persis" +
"t security info=False;initial catalog=jifei";
//
// sqlInsertCommand1
//
this.sqlInsertCommand1.CommandText = "INSERT INTO 收費(fèi)流水表(時(shí)間, 條形碼, 值班教師, 收費(fèi), 充值) VALUES (@時(shí)間, @條形碼, @值班教師, @收費(fèi), @充值); SEL" +
"ECT ID, 時(shí)間, 條形碼, 值班教師, 收費(fèi), 充值 FROM 收費(fèi)流水表 WHERE (ID = @@IDENTITY)";
this.sqlInsertCommand1.Connection = this.sqlConnection1;
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@時(shí)間", System.Data.SqlDbType.DateTime, 8, "時(shí)間"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@條形碼", System.Data.SqlDbType.VarChar, 50, "條形碼"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@值班教師", System.Data.SqlDbType.VarChar, 50, "值班教師"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@收費(fèi)", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, false, ((System.Byte)(5)), ((System.Byte)(2)), "收費(fèi)", System.Data.DataRowVersion.Current, null));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@充值", System.Data.SqlDbType.Decimal, 5, System.Data.ParameterDirection.Input, false, ((System.Byte)(5)), ((System.Byte)(2)), "充值", System.Data.DataRowVersion.Current, null));
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "SELECT ID, 時(shí)間, 條形碼, 值班教師, 收費(fèi), 充值 FROM 收費(fèi)流水表";
this.sqlSelectCommand1.Connection = this.sqlConnection1;
//
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -