📄 mainform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace XFMAS.Admin
{
/// <summary>
/// MainForm 的摘要说明。
/// </summary>
public class MainForm : System.Windows.Forms.Form {
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItem5;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.MenuItem menuItem6;
private System.Windows.Forms.MenuItem menuItem7;
private System.Windows.Forms.MenuItem menuItem8;
private System.Windows.Forms.MenuItem menuItem9;
private System.Windows.Forms.MenuItem menuItem10;
private System.Windows.Forms.MenuItem menuItem11;
private System.Windows.Forms.MenuItem menuItem12;
private System.Windows.Forms.MenuItem menuItem13;
private System.Windows.Forms.MenuItem menuItem14;
private System.Windows.Forms.MenuItem menuItem15;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem menuItem16;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.ComboBox month;
private System.Windows.Forms.ComboBox year;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.DateTimePicker startDate;
private System.Windows.Forms.DateTimePicker endDate;
private System.Windows.Forms.Button button1;
private System.ComponentModel.IContainer components;
//
private DataSet ds = null;
public System.Windows.Forms.ComboBox userID;
private string _UID = null;
private string _DAT = null;
private string _IT = null;
private bool needSave = false;
/// <summary>
/// 指定的用户编号
/// </summary>
public string UID = null;
//打印
private ReportLibrary.ReportDocument rd = null;
public bool isHistory = false;
public MainForm() {
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.Text = Public.systemName + "[管理中心][登录用户:"+ Public.currentUserName +"]";
this.year.Text = DateTime.Now.Year.ToString() + "年";
this.month.Text = DateTime.Now.Month.ToString() + "月";
//年份事件
this.year.SelectedIndexChanged += new System.EventHandler(this.year_SelectedIndexChanged);
//载入所有用户
this.LoadAllUsers();
this.startDate.Text = DateTime.Now.Year.ToString() + "年" + DateTime.Now.Month.ToString() + "月" + "1日";
this.endDate.Text = DateTime.Now.Year.ToString() + "年" + DateTime.Now.Month.ToString() + "月" + Public.GetMonthEndDay(DateTime.Now.Month.ToString()) +"日";
//检查权限
if(!Public.CheckIsRule("R_001") && Public.currentRCS != "CLIENT"){
this.year.Enabled = false;
this.month.Enabled = false;
this.button1.Enabled = false;
this.menuItem5.Enabled = false;
}
//没有查看用户的权限
if(!Public.CheckIsRule("R_003") && !Public.CheckIsRule("R_002")){
this.menuItem8.Enabled = false;
}
//没有提醒设置的权限
if(!Public.CheckIsRule("R_004")){
this.menuItem14.Enabled = false;
}
//注册IP、用户的权限
if(!Public.CheckIsRule("R_005")){
this.menuItem3.Enabled = false;
}
}
/// <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.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem5 = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.menuItem7 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem8 = new System.Windows.Forms.MenuItem();
this.menuItem9 = new System.Windows.Forms.MenuItem();
this.menuItem10 = new System.Windows.Forms.MenuItem();
this.menuItem12 = new System.Windows.Forms.MenuItem();
this.menuItem11 = new System.Windows.Forms.MenuItem();
this.menuItem13 = new System.Windows.Forms.MenuItem();
this.menuItem14 = new System.Windows.Forms.MenuItem();
this.menuItem16 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.menuItem15 = new System.Windows.Forms.MenuItem();
this.label1 = new System.Windows.Forms.Label();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.panel1 = new System.Windows.Forms.Panel();
this.userID = new System.Windows.Forms.ComboBox();
this.button1 = new System.Windows.Forms.Button();
this.endDate = new System.Windows.Forms.DateTimePicker();
this.startDate = new System.Windows.Forms.DateTimePicker();
this.label8 = new System.Windows.Forms.Label();
this.year = new System.Windows.Forms.ComboBox();
this.month = new System.Windows.Forms.ComboBox();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem2,
this.menuItem4});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem5,
this.menuItem6,
this.menuItem7});
this.menuItem1.Text = "文件(&F)";
//
// menuItem5
//
this.menuItem5.Index = 0;
this.menuItem5.Text = "打印(&P)";
this.menuItem5.Click += new System.EventHandler(this.menuItem5_Click);
//
// menuItem6
//
this.menuItem6.Index = 1;
this.menuItem6.Text = "-";
//
// menuItem7
//
this.menuItem7.Index = 2;
this.menuItem7.Text = "退出(&E)";
this.menuItem7.Click += new System.EventHandler(this.menuItem7_Click);
//
// menuItem2
//
this.menuItem2.Index = 1;
this.menuItem2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem8,
this.menuItem9,
this.menuItem10,
this.menuItem12,
this.menuItem11,
this.menuItem13,
this.menuItem14,
this.menuItem16,
this.menuItem3});
this.menuItem2.Text = "设置(&S)";
//
// menuItem8
//
this.menuItem8.Index = 0;
this.menuItem8.Text = "登录服务器设置(&R)";
this.menuItem8.Click += new System.EventHandler(this.menuItem8_Click);
//
// menuItem9
//
this.menuItem9.Index = 1;
this.menuItem9.Text = "-";
this.menuItem9.Visible = false;
//
// menuItem10
//
this.menuItem10.Index = 2;
this.menuItem10.Text = "系统设置(&S)";
this.menuItem10.Visible = false;
//
// menuItem12
//
this.menuItem12.Index = 3;
this.menuItem12.Text = "-";
//
// menuItem11
//
this.menuItem11.Index = 4;
this.menuItem11.Text = "用户设置(&U)";
this.menuItem11.Click += new System.EventHandler(this.menuItem11_Click);
//
// menuItem13
//
this.menuItem13.Index = 5;
this.menuItem13.Text = "-";
//
// menuItem14
//
this.menuItem14.Index = 6;
this.menuItem14.Text = "提醒时间设置(&A)";
this.menuItem14.Click += new System.EventHandler(this.menuItem14_Click);
//
// menuItem16
//
this.menuItem16.Index = 7;
this.menuItem16.Text = "-";
//
// menuItem3
//
this.menuItem3.Index = 8;
this.menuItem3.Text = "注册IP地址到服务器(&I)";
this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
//
// menuItem4
//
this.menuItem4.Index = 2;
this.menuItem4.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem15});
this.menuItem4.Text = "帮助(&H)";
//
// menuItem15
//
this.menuItem15.Index = 0;
this.menuItem15.Text = "关于系统(&A)";
this.menuItem15.Click += new System.EventHandler(this.menuItem15_Click);
//
// label1
//
this.label1.BackColor = System.Drawing.Color.DarkSeaGreen;
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label1.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(560, 40);
this.label1.TabIndex = 0;
this.label1.Text = "食堂就餐历史数据统计查询";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// imageList1
//
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// panel1
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -