📄 user.cs
字号:
using System;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace _3Dmanager
{
/// <summary>
/// user 的摘要说明。
/// </summary>
public class user : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.ComboBox comboBox1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public user()
{
//
// 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.dataGrid1 = new System.Windows.Forms.DataGrid();
this.button1 = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.button2 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.button3 = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.AlternatingBackColor = System.Drawing.Color.WhiteSmoke;
this.dataGrid1.BackColor = System.Drawing.Color.Gainsboro;
this.dataGrid1.BackgroundColor = System.Drawing.Color.DarkGray;
this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dataGrid1.CaptionBackColor = System.Drawing.Color.DarkKhaki;
this.dataGrid1.CaptionFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
this.dataGrid1.CaptionForeColor = System.Drawing.Color.Black;
this.dataGrid1.DataMember = "";
this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.dataGrid1.FlatMode = true;
this.dataGrid1.Font = new System.Drawing.Font("Times New Roman", 9F);
this.dataGrid1.ForeColor = System.Drawing.Color.Black;
this.dataGrid1.GridLineColor = System.Drawing.Color.Silver;
this.dataGrid1.HeaderBackColor = System.Drawing.Color.Black;
this.dataGrid1.HeaderFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
this.dataGrid1.HeaderForeColor = System.Drawing.Color.White;
this.dataGrid1.LinkColor = System.Drawing.Color.DarkSlateBlue;
this.dataGrid1.Location = new System.Drawing.Point(0, 108);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ParentRowsBackColor = System.Drawing.Color.LightGray;
this.dataGrid1.ParentRowsForeColor = System.Drawing.Color.Black;
this.dataGrid1.ReadOnly = true;
this.dataGrid1.SelectionBackColor = System.Drawing.Color.Firebrick;
this.dataGrid1.SelectionForeColor = System.Drawing.Color.White;
this.dataGrid1.Size = new System.Drawing.Size(592, 256);
this.dataGrid1.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(432, 16);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(80, 23);
this.button1.TabIndex = 1;
this.button1.Text = "查看";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioButton2);
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Location = new System.Drawing.Point(8, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(408, 48);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
//
// radioButton2
//
this.radioButton2.BackColor = System.Drawing.Color.RosyBrown;
this.radioButton2.Location = new System.Drawing.Point(240, 16);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(120, 24);
this.radioButton2.TabIndex = 1;
this.radioButton2.Text = " 会员业务信息";
//
// radioButton1
//
this.radioButton1.BackColor = System.Drawing.Color.RosyBrown;
this.radioButton1.Location = new System.Drawing.Point(32, 16);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(120, 24);
this.radioButton1.TabIndex = 0;
this.radioButton1.Text = " 会员基本信息";
//
// button2
//
this.button2.Location = new System.Drawing.Point(512, 72);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(72, 24);
this.button2.TabIndex = 3;
this.button2.Text = "退出";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(32, 72);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(240, 21);
this.textBox1.TabIndex = 4;
this.textBox1.Text = "";
//
// button3
//
this.button3.Location = new System.Drawing.Point(400, 72);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(96, 23);
this.button3.TabIndex = 5;
this.button3.Text = "条件查询";
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// comboBox1
//
this.comboBox1.Items.AddRange(new object[] {
"用户名",
"姓名",
"职业"});
this.comboBox1.Location = new System.Drawing.Point(296, 72);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(96, 20);
this.comboBox1.TabIndex = 6;
this.comboBox1.Text = "请选择";
//
// user
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(592, 364);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.button3);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.button1);
this.Controls.Add(this.dataGrid1);
this.Name = "user";
this.Text = "会员业务";
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void button1_Click(object sender, System.EventArgs e)
{
int i=0;
if(radioButton1.Checked)
i=1;
else if(radioButton2.Checked)
i=0;
System.Data.DataTable dt=_3DLib.SelectAll.getAllInfo(i);
OleDbDataAdapter da=new OleDbDataAdapter();
this.dataGrid1.DataSource=dt;
}
private void button3_Click(object sender, System.EventArgs e)
{
int i=0;string table=null;
if(radioButton1.Checked)
{
i=1;
table="会员";
}
else if(radioButton2.Checked)
{
i=2;
table="会员日志";
}
else
{
MessageBox.Show("清选择查询类型!");
radioButton1.Focus();
}
string text=textBox1.Text;
string text1=comboBox1.Text;
if(text1.Equals("请选择"))
{
MessageBox.Show("请选择类型!");
comboBox1.Focus();
}
System.Data.DataTable dt1=new DataTable();
if(i==1)
dt1=_3DLib.SelectAll.getOneInfo(table,text,text1);
// else if(i==2)
//dt1=_3DLib.SelectAll.getOneInfo(text);
OleDbDataAdapter da=new OleDbDataAdapter();
this.dataGrid1.DataSource=dt1;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -