📄 frmdata.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
using library.VisiteDB;
namespace library.Forms
{
public class frmData : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dg;
private System.ComponentModel.Container components = null;
public static string strCommond = "";
public static bool bookCanLend = true;
public frmData()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.dg = new System.Windows.Forms.DataGrid();
((System.ComponentModel.ISupportInitialize)(this.dg)).BeginInit();
this.SuspendLayout();
//
// dg
//
this.dg.DataMember = "";
this.dg.Dock = System.Windows.Forms.DockStyle.Fill;
this.dg.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dg.Location = new System.Drawing.Point(0, 0);
this.dg.Name = "dg";
this.dg.Size = new System.Drawing.Size(408, 294);
this.dg.TabIndex = 0;
//
// frmData
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(408, 294);
this.Controls.Add(this.dg);
this.Name = "frmData";
this.Load += new System.EventHandler(this.frmData_Load);
((System.ComponentModel.ISupportInitialize)(this.dg)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void frmData_Load(object sender, System.EventArgs e)
{
DataEngine de = new DataEngine();
DataSet ds = new DataSet();
if(strCommond == "user")
{
de.getUserList(ds);
dg.DataSource=ds.Tables["user"];
}
else if(strCommond == "bookOK")
{
frmData.bookCanLend = true;
de.getBookList(ds);
dg.DataSource=ds.Tables["book"];
}
else if(strCommond == "bookNO")
{
frmData.bookCanLend = false;
de.getBookList(ds);
dg.DataSource=ds.Tables["book"];
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -