📄 adminyw.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
namespace _3Dmanager
{
/// <summary>
/// AdminYw 的摘要说明。
/// </summary>
public class AdminYw : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public AdminYw()
{
//
// 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.button2 = new System.Windows.Forms.Button();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
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.Top;
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, 0);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ParentRowsBackColor = System.Drawing.Color.LightGray;
this.dataGrid1.ParentRowsForeColor = System.Drawing.Color.Black;
this.dataGrid1.SelectionBackColor = System.Drawing.Color.Firebrick;
this.dataGrid1.SelectionForeColor = System.Drawing.Color.White;
this.dataGrid1.Size = new System.Drawing.Size(448, 304);
this.dataGrid1.TabIndex = 0;
this.dataGrid1.Navigate += new System.Windows.Forms.NavigateEventHandler(this.dataGrid1_Navigate);
//
// button1
//
this.button1.Location = new System.Drawing.Point(32, 328);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "导出报表";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(328, 328);
this.button2.Name = "button2";
this.button2.TabIndex = 2;
this.button2.Text = "退出";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// AdminYw
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(448, 381);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.dataGrid1);
this.Name = "AdminYw";
this.Text = "管理员日志";
this.Load += new System.EventHandler(this.AdminYw_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void button2_Click(object sender, System.EventArgs e)
{
this.Dispose();
}
private void dataGrid1_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
{
}
private void AdminYw_Load(object sender, System.EventArgs e)
{
this.dataGrid1.DataSource=log.Query.getAllInfo();
}
private void button1_Click(object sender, System.EventArgs e)
{
string filename;
if (this.saveFileDialog1.ShowDialog() == DialogResult.OK)
{
filename = this.saveFileDialog1.FileName;
OperateCsvFile.CsvExport.Export(((DataTable)(this.dataGrid1.DataSource)),filename);
MessageBox.Show("成功导出");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -