⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cs

📁 人事管理系统
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Data.SqlClient;

namespace BlueHill_Win_
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
        }

        //private void button1_Click(object sender, EventArgs e)
        //{
        //    //this.Hide();
        //    Employees E = new Employees();
        //    E.Show();
        //}

        //private void button2_Click(object sender, EventArgs e)
        //{
        //    //this.Hide();
        //    DeptManagement DeptM = new DeptManagement();
        //    DeptM.Show();
        //}

        //private void button3_Click(object sender, EventArgs e)
        //{
        //    //this.Hide();
        //    VacationManagement VM = new VacationManagement();
        //    VM.Show();
        //}

        //private void button4_Click(object sender, EventArgs e)
        //{
        //    //this.Hide();
        //    AttendanceManagements AM = new AttendanceManagements();
        //    AM.Show(); ;

        //}

        //private void button5_Click(object sender, EventArgs e)
        //{
        //    WorkingOvertimeManagement WOM = new WorkingOvertimeManagement();
        //    WOM.Show();
        //}

        //private void button6_Click(object sender, EventArgs e)
        //{
        //    //this.Hide();
        //    SalaryManagements SM = new SalaryManagements();
        //    SM.Show();
        //}

        //private void button7_Click(object sender, EventArgs e)
        //{
        //    //this.Hide();
        //    SystemEvent SE = new SystemEvent();
        //    SE.Show();
        //}

        //private void button8_Click(object sender, EventArgs e)
        
        //{
        //    DialogResult = MessageBox.Show("你真的要退出本系统吗? 如果退出,你需要启动该程序!", "南山人事管理系统提示你", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

        //    if (DialogResult==DialogResult.OK)
        //    {
        //        Application.ExitThread();
        //    }
            
        //}

        private void Main_Load(object sender, EventArgs e)
        {

            Win32.AnimateWindow(this.Handle, 2000, Win32.AW_BLEND);//窗体渐显效果

            if (Convert.ToInt32( System.DateTime.Now.Hour.ToString()) > 11 && Convert.ToInt32( System.DateTime.Now.Hour.ToString()) <= 18)
            {
                toolStripLabel2.Text = "下午好!";
            }
            else
            {
                if (Convert.ToInt32(System.DateTime.Now.Hour.ToString()) > 5 && Convert.ToInt32(System.DateTime.Now.Hour.ToString()) <= 11)
                {
                    toolStripLabel2.Text = "上午好!";
                }
                else
                {
                    toolStripLabel2.Text = "晚上好!";
                }
            }
            toolStripLabel1.Text = DB.getA;

            //toolStripTextBox1.Text.ToString() = System.DateTime.Now;
            
        }

        private void 计算器ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
        }

        private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            this.Visible = true;//点击任务栏图标

            this.WindowState = FormWindowState.Normal;

            this.notifyIcon1.Visible = false; 


        }

        private void Main_SizeChanged(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Minimized)
            {
                this.Hide();
                this.notifyIcon1.Visible = true;
            } 

        }

        private void Main_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult = MessageBox.Show("你真的要退出本系统吗? 如果退出,请保存好数据!", "南山人事管理系统提示你", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (DialogResult == DialogResult.OK)
            {
                Application.ExitThread();
            }
            else
                e.Cancel = true;
            //Win32.AnimateWindow(this.Handle, 2000, Win32.AW_SLIDE | Win32.AW_HIDE | Win32.AW_BLEND);

        }

        private void 关于南山人事管理系统ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.TopMost == false) this.TopMost = true;
            else this.TopMost = false;
        }

        private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
        {

        }

        private void 退出登陆ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult = MessageBox.Show("你真的要退出本系统吗? 如果退出,你需要启动该程序!", "南山人事管理系统提示你", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (DialogResult == DialogResult.OK)
            {
                Application.ExitThread();
            }
        }

        private void 退出系统ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult = MessageBox.Show("你真的要注销登陆吗?", "南山人事管理系统提示你", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (DialogResult == DialogResult.OK)
            {
                this.Hide();
                Login L = new Login();
                L.Show();

            }
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            Target T = new Target();
            T.ShowDialog();
        }

        private void 更改密码ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EditPassword EP = new EditPassword();
            EP.Show();
        }

        private void toolStripMenuItem3_Click(object sender, EventArgs e)
        {
            About A = new About();
            A.Show();
        }

        private void 显示主窗口ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Visible = true;//点击任务栏图标

            this.WindowState = FormWindowState.Normal;

            this.notifyIcon1.Visible = false; 
        }

        private void toolStripButton10_Click(object sender, EventArgs e)
        {
            DialogResult = MessageBox.Show("你真的要退出本系统吗? 如果退出,请保存好数据!", "南山人事管理系统提示你", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (DialogResult == DialogResult.OK)
            {
                Application.ExitThread();
            }
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            Employees E = new Employees();
            E.Show();
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            DeptManagement DeptM = new DeptManagement();
            DeptM.Show();
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            VacationManagement VM = new VacationManagement();
            VM.Show();
        }

        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            AttendanceManagements AM = new AttendanceManagements();
            AM.Show(); ;
        }

        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            WorkingOvertimeManagement WOM = new WorkingOvertimeManagement();
            WOM.Show();
        }

        private void toolStripButton7_Click(object sender, EventArgs e)
        {
            SalaryManagements SM = new SalaryManagements();
            SM.Show();
        }

        private void toolStripButton8_Click(object sender, EventArgs e)
        {
            SystemEvent SE = new SystemEvent();
            SE.Show();
        }

        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        private void toolStripMenuItem5_Click(object sender, EventArgs e)
        {
            try
            {
                System.Diagnostics.Process.Start("@Folder\\calc.exe");
            }
            catch (Exception ec)
            {
                DialogResult = MessageBox.Show("程序不存在!", "南山人事管理系统提示你", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -