📄 parentframe.cs
字号:
#region 引用类库命名...
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
#endregion
namespace WindowsApplication.EmployeeLeaveManager
{
public class ParentFrame : System.Windows.Forms.Form
{
#region 控件集合...
protected System.Windows.Forms.Label label1;
protected System.Windows.Forms.ToolBar tool;
protected System.Windows.Forms.StatusBar status;
private System.Windows.Forms.StatusBarPanel statusDate;
private System.Windows.Forms.StatusBarPanel statusTime;
private System.Windows.Forms.StatusBarPanel statusUser;
protected System.Windows.Forms.StatusBarPanel statusZhuangTai;
protected System.Windows.Forms.ImageList imageList;
protected System.Windows.Forms.Timer currentTime;
private System.Windows.Forms.ToolBarButton toolFirst;
private System.Windows.Forms.ToolBarButton toolBarButton2;
private System.Windows.Forms.ToolBarButton toolLast;
private System.Windows.Forms.ToolBarButton toolBarButton4;
private System.Windows.Forms.ToolBarButton toolNext;
private System.Windows.Forms.ToolBarButton toolBarButton6;
private System.Windows.Forms.ToolBarButton toolEnd;
private System.Windows.Forms.ToolBarButton toolBarButton8;
private System.Windows.Forms.ToolBarButton toolSearch;
private System.Windows.Forms.ToolBarButton toolBarButton10;
private System.Windows.Forms.ToolBarButton toolDelete;
private System.Windows.Forms.ToolBarButton toolBarButton1;
private System.Windows.Forms.ToolBarButton toolExit;
protected System.Windows.Forms.DataGrid dataGrid;
protected System.Windows.Forms.ContextMenu contextMenu;
private System.Windows.Forms.MenuItem menuEmp_Name;
private System.Windows.Forms.MenuItem menuDate;
private System.ComponentModel.IContainer components;
protected DataTable dataTable=null;
protected System.Data.SqlClient.SqlDataAdapter dataAdapter=null;
protected System.Data.OleDb.OleDbDataAdapter oleAdapter=null;
protected System.Data.DataSet ds=new DataSet();
protected System.Data.DataSet dataSet=new DataSet();
protected System.Windows.Forms.StatusBarPanel statusText;
protected System.Windows.Forms.Label label2;
protected System.Windows.Forms.Label label3;
protected System.Windows.Forms.TextBox textSearchA;
protected System.Windows.Forms.CheckBox TextCheckBox;
protected System.Windows.Forms.TextBox textSearchB;
protected System.Windows.Forms.Label label4;
protected System.Windows.Forms.Button btnSearch;
protected System.Windows.Forms.TextBox textSearchC;
//以下是数据绑定时控件.
protected System.Windows.Forms.CurrencyManager cmOrders=null;
//以下是检查是否单击了修改按钮.
#endregion
#region 构造函数...
public ParentFrame()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#endregion
#region 变量定义...
protected string stringTimeStr="";
protected string stringDateStr="";
protected string stringStautsStr="";
protected string stringMaxStr="";
protected string stringUserStr="";
#endregion
#region 查询字符串...
protected string emp_timeStr="";
protected string emp_UncomeStr="";
protected string emp_LateStr="";
protected string emp_zhaoTuiStr="";
#endregion
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ParentFrame));
this.label1 = new System.Windows.Forms.Label();
this.imageList = new System.Windows.Forms.ImageList(this.components);
this.tool = new System.Windows.Forms.ToolBar();
this.toolFirst = new System.Windows.Forms.ToolBarButton();
this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
this.toolLast = new System.Windows.Forms.ToolBarButton();
this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
this.toolNext = new System.Windows.Forms.ToolBarButton();
this.toolBarButton6 = new System.Windows.Forms.ToolBarButton();
this.toolEnd = new System.Windows.Forms.ToolBarButton();
this.toolBarButton8 = new System.Windows.Forms.ToolBarButton();
this.toolSearch = new System.Windows.Forms.ToolBarButton();
this.contextMenu = new System.Windows.Forms.ContextMenu();
this.menuEmp_Name = new System.Windows.Forms.MenuItem();
this.menuDate = new System.Windows.Forms.MenuItem();
this.toolBarButton10 = new System.Windows.Forms.ToolBarButton();
this.toolDelete = new System.Windows.Forms.ToolBarButton();
this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
this.toolExit = new System.Windows.Forms.ToolBarButton();
this.status = new System.Windows.Forms.StatusBar();
this.statusText = new System.Windows.Forms.StatusBarPanel();
this.statusDate = new System.Windows.Forms.StatusBarPanel();
this.statusTime = new System.Windows.Forms.StatusBarPanel();
this.statusUser = new System.Windows.Forms.StatusBarPanel();
this.statusZhuangTai = new System.Windows.Forms.StatusBarPanel();
this.currentTime = new System.Windows.Forms.Timer(this.components);
this.dataGrid = new System.Windows.Forms.DataGrid();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textSearchA = new System.Windows.Forms.TextBox();
this.TextCheckBox = new System.Windows.Forms.CheckBox();
this.textSearchB = new System.Windows.Forms.TextBox();
this.textSearchC = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.btnSearch = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.statusText)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusDate)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusTime)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusUser)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusZhuangTai)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.ImageList = this.imageList;
this.label1.Location = new System.Drawing.Point(0, 40);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(752, 40);
this.label1.TabIndex = 0;
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// imageList
//
this.imageList.ImageSize = new System.Drawing.Size(16, 16);
this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
this.imageList.TransparentColor = System.Drawing.Color.Transparent;
//
// tool
//
this.tool.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
this.tool.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tool.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolFirst,
this.toolBarButton2,
this.toolLast,
this.toolBarButton4,
this.toolNext,
this.toolBarButton6,
this.toolEnd,
this.toolBarButton8,
this.toolSearch,
this.toolBarButton10,
this.toolDelete,
this.toolBarButton1,
this.toolExit});
this.tool.ButtonSize = new System.Drawing.Size(40, 35);
this.tool.Cursor = System.Windows.Forms.Cursors.Hand;
this.tool.DropDownArrows = true;
this.tool.ImageList = this.imageList;
this.tool.Location = new System.Drawing.Point(0, 0);
this.tool.Name = "tool";
this.tool.ShowToolTips = true;
this.tool.Size = new System.Drawing.Size(746, 42);
this.tool.TabIndex = 1;
this.tool.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tool_ButtonClick);
//
// toolFirst
//
this.toolFirst.ImageIndex = 0;
this.toolFirst.Text = "首记录";
this.toolFirst.ToolTipText = "首记录";
//
// toolBarButton2
//
this.toolBarButton2.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
//
// toolLast
//
this.toolLast.ImageIndex = 1;
this.toolLast.Text = "上一条记录";
this.toolLast.ToolTipText = "上一条记录";
//
// toolBarButton4
//
this.toolBarButton4.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
//
// toolNext
//
this.toolNext.ImageIndex = 2;
this.toolNext.Text = "下一条记录";
this.toolNext.ToolTipText = "下一条记录";
//
// toolBarButton6
//
this.toolBarButton6.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
//
// toolEnd
//
this.toolEnd.ImageIndex = 3;
this.toolEnd.Text = "尾记录";
this.toolEnd.ToolTipText = "尾记录";
//
// toolBarButton8
//
this.toolBarButton8.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
//
// toolSearch
//
this.toolSearch.DropDownMenu = this.contextMenu;
this.toolSearch.ImageIndex = 4;
this.toolSearch.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
this.toolSearch.Text = "查询";
this.toolSearch.ToolTipText = "出现小对话...";
this.toolSearch.Visible = false;
//
// contextMenu
//
this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuEmp_Name,
this.menuDate});
//
// menuEmp_Name
//
this.menuEmp_Name.Index = 0;
this.menuEmp_Name.Text = "职工名称查询(&N)";
this.menuEmp_Name.Click += new System.EventHandler(this.menuEmp_Name_Click);
//
// menuDate
//
this.menuDate.Index = 1;
this.menuDate.Text = "日期(&D)";
this.menuDate.Click += new System.EventHandler(this.menuDate_Click);
//
// toolBarButton10
//
this.toolBarButton10.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
this.toolBarButton10.Visible = false;
//
// toolDelete
//
this.toolDelete.ImageIndex = 5;
this.toolDelete.Text = "清除历史";
this.toolDelete.ToolTipText = "清除历史";
//
// toolBarButton1
//
this.toolBarButton1.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
//
// toolExit
//
this.toolExit.ImageIndex = 6;
this.toolExit.Text = "退出";
this.toolExit.ToolTipText = "关闭窗体...";
//
// status
//
this.status.Cursor = System.Windows.Forms.Cursors.AppStarting;
this.status.Location = new System.Drawing.Point(0, 391);
this.status.Name = "status";
this.status.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
this.statusText,
this.statusDate,
this.statusTime,
this.statusUser,
this.statusZhuangTai});
this.status.ShowPanels = true;
this.status.Size = new System.Drawing.Size(746, 32);
this.status.TabIndex = 2;
//
// statusText
//
this.statusText.Icon = ((System.Drawing.Icon)(resources.GetObject("statusText.Icon")));
this.statusText.Width = 150;
//
// statusDate
//
this.statusDate.Icon = ((System.Drawing.Icon)(resources.GetObject("statusDate.Icon")));
this.statusDate.Text = "日期:";
this.statusDate.Width = 150;
//
// statusTime
//
this.statusTime.Icon = ((System.Drawing.Icon)(resources.GetObject("statusTime.Icon")));
this.statusTime.Text = "时间:";
this.statusTime.Width = 150;
//
// statusUser
//
this.statusUser.Icon = ((System.Drawing.Icon)(resources.GetObject("statusUser.Icon")));
this.statusUser.Text = "操作员:";
this.statusUser.Width = 150;
//
// statusZhuangTai
//
this.statusZhuangTai.Icon = ((System.Drawing.Icon)(resources.GetObject("statusZhuangTai.Icon")));
this.statusZhuangTai.Text = "状态:无";
this.statusZhuangTai.Width = 150;
//
// currentTime
//
this.currentTime.Enabled = true;
this.currentTime.Interval = 1000;
this.currentTime.Tick += new System.EventHandler(this.currentTime_Tick);
//
// dataGrid
//
this.dataGrid.AlternatingBackColor = System.Drawing.Color.Lavender;
this.dataGrid.BackColor = System.Drawing.Color.WhiteSmoke;
this.dataGrid.BackgroundColor = System.Drawing.Color.LightGray;
this.dataGrid.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dataGrid.CaptionBackColor = System.Drawing.Color.LightSteelBlue;
this.dataGrid.CaptionForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid.CaptionText = "显示信息管理";
this.dataGrid.CaptionVisible = false;
this.dataGrid.DataMember = "";
this.dataGrid.FlatMode = true;
this.dataGrid.Font = new System.Drawing.Font("Tahoma", 8F);
this.dataGrid.ForeColor = System.Drawing.Color.MidnightBlue;
this.dataGrid.GridLineColor = System.Drawing.Color.Gainsboro;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -