major.cs
上传用户:zhongfine
上传日期:2022-08-01
资源大小:2860k
文件大小:8k
源码类别:

企业管理

开发平台:

C#

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.Data.SqlClient;
  10. namespace 人事管理系统
  11. {
  12.     public partial class major : Form
  13.     {
  14.         public major()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.         private void button2_Click(object sender, EventArgs e)
  19.         {
  20.             if (label10.Text == "普通用户")
  21.             {
  22.                 MessageBox.Show("您的权限不够,无法使用该项!");
  23.                 //button2.Enabled = false;
  24.                
  25.             }
  26.             else
  27.             {
  28.                 employee_add myemployee_add = new employee_add();
  29.                 myemployee_add.ShowDialog();
  30.             }
  31.         }
  32.         private void button3_Click(object sender, EventArgs e)
  33.         {
  34.             if (label10.Text == "普通用户")
  35.             {
  36.                 MessageBox.Show("您的权限不够,无法使用该项!");
  37.                 //button2.Enabled = false;
  38.             }
  39.             else
  40.             {
  41.                 PERSONNEL_CHANGE myPERSONNEL_CHANGE = new PERSONNEL_CHANGE();
  42.                 myPERSONNEL_CHANGE.ShowDialog();
  43.             }
  44.         }
  45.         private void button4_Click(object sender, EventArgs e)
  46.         {
  47.                       
  48.             employee_inf myemployee_inf = new employee_inf();
  49.             myemployee_inf.label3.Text = label10.Text;
  50.             myemployee_inf.label5.Text = label9.Text;
  51.             myemployee_inf.label8.Text = label14.Text;
  52.             myemployee_inf.ShowDialog();
  53.         }
  54.       
  55.         private void button1_Click(object sender, EventArgs e)
  56.         {
  57.             choose mychoose = new choose();
  58.             mychoose.label1.Text = label10.Text;
  59.             mychoose.label2.Text = label9.Text;
  60.             this.Hide();
  61.             mychoose.Show();
  62.            
  63.         }
  64.         private void button5_Click(object sender, EventArgs e)
  65.         {
  66.             if (label10.Text == "普通用户")
  67.             {
  68.                 MessageBox.Show("您的权限不够,无法使用该项!");
  69.                 //button2.Enabled = false;
  70.             }
  71.             else
  72.             {
  73.                 department mydepartment = new department();
  74.                 mydepartment.ShowDialog();
  75.             }
  76.         }
  77.         private void button7_Click(object sender, EventArgs e)
  78.         {
  79.             CHANGE_TEXT mychange_text = new CHANGE_TEXT();
  80.             mychange_text.label1.Text = label10.Text;
  81.             mychange_text.ShowDialog();
  82.         }
  83.         private void 注销ToolStripMenuItem1_Click(object sender, EventArgs e)
  84.         {
  85.             this.Hide();
  86.             loading myloading = new loading();
  87.             myloading.Visible = true;
  88.         }
  89.         private void 退出ToolStripMenuItem1_Click(object sender, EventArgs e)
  90.         {
  91.            
  92.             if (DialogResult.OK ==  MessageBox.Show("确认退出系统吗?","信息提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information))
  93.             {
  94.                 this.HideForm1.Start();
  95.                
  96.             } 
  97.             else
  98.             {
  99.                 return;
  100.             
  101.             }
  102.         }
  103.         private void 增加ToolStripMenuItem_Click(object sender, EventArgs e)
  104.         {
  105.             if (label10.Text == "普通用户")
  106.             {
  107.                 MessageBox.Show("您的权限不够,无法使用该项!");
  108.                 //button2.Enabled = false;
  109.             }
  110.             else
  111.             {
  112.                 employee_add myemployee_add = new employee_add();
  113.                 myemployee_add.ShowDialog();
  114.             }
  115.         }
  116.         private void 员工信息查询修改ToolStripMenuItem1_Click(object sender, EventArgs e)
  117.         {
  118.             
  119.             employee_inf myemployee_inf = new employee_inf();
  120.             myemployee_inf.label3.Text = label10.Text;
  121.             myemployee_inf.label5.Text = label9.Text;
  122.             myemployee_inf.label8.Text = label14.Text;
  123.             myemployee_inf.ShowDialog();
  124.         }
  125.         private void 人事变动ToolStripMenuItem1_Click(object sender, EventArgs e)
  126.         {
  127.             if (label10.Text == "普通用户")
  128.             {
  129.                 MessageBox.Show("您的权限不够,无法使用该项!");
  130.                 //button2.Enabled = false;
  131.             }
  132.             else
  133.             {
  134.                 PERSONNEL_CHANGE myPERSONNEL_CHANGE = new PERSONNEL_CHANGE();
  135.                 myPERSONNEL_CHANGE.ShowDialog();
  136.             }
  137.         }
  138.         private void 人事变动记录ToolStripMenuItem_Click(object sender, EventArgs e)
  139.         {
  140.             CHANGE_TEXT mychange_text = new CHANGE_TEXT();
  141.             mychange_text.ShowDialog();
  142.         }
  143.         private void button6_Click(object sender, EventArgs e)
  144.         {
  145.             if (label10.Text == "普通用户")
  146.             {
  147.                 MessageBox.Show("您的权限不够,无法使用该项!");
  148.                 //button2.Enabled = false;
  149.             }
  150.             else
  151.             {
  152.                 job myjob = new job();
  153.                 myjob.ShowDialog();
  154.             }
  155.         }
  156.         private void button8_Click(object sender, EventArgs e)
  157.         {
  158.             about myabout = new about();
  159.             myabout.ShowDialog();
  160.         }
  161.         private void 关于软件ToolStripMenuItem_Click(object sender, EventArgs e)
  162.         {
  163.             about myabout = new about();
  164.             myabout.ShowDialog();
  165.         }
  166.         private void 部门管理ToolStripMenuItem1_Click(object sender, EventArgs e)
  167.         {
  168.             if (label10.Text == "普通用户")
  169.             {
  170.                 MessageBox.Show("您的权限不够,无法使用该项!");
  171.                 //button2.Enabled = false;
  172.             }
  173.             else
  174.             {
  175.                 department mydepartment = new department();
  176.                 mydepartment.ShowDialog();
  177.             }
  178.         }
  179.         private void 职位管理ToolStripMenuItem1_Click(object sender, EventArgs e)
  180.         {
  181.             if (label10.Text == "普通用户")
  182.             {
  183.                 MessageBox.Show("您的权限不够,无法使用该项!");
  184.                 //button2.Enabled = false;
  185.             }
  186.             else
  187.             {
  188.                 job myjob = new job();
  189.                 myjob.ShowDialog();
  190.             }
  191.         }
  192.         private void 员工密码修改ToolStripMenuItem_Click(object sender, EventArgs e)
  193.         {
  194.             passwd_change mypasswd_change = new passwd_change();
  195.             mypasswd_change.label5.Text = label14.Text;
  196.             mypasswd_change.ShowDialog();
  197.         }
  198.         private void major_Load(object sender, EventArgs e)
  199.         {
  200.            
  201.             //timer控件ShowForm1
  202.             this.ShowForm1.Enabled = true; //控件是否激活
  203.             this.ShowForm1.Interval = 50; //Elapsed 事件的频率
  204.             //timer控件HideForm1
  205.             this.HideForm1.Enabled = false;
  206.             this.HideForm1.Interval = 30;
  207.             this.Opacity = 0.0;  //设置窗体透明度
  208.             ShowForm1.Start();  //timer控件 ShowForm1开始
  209.         }
  210.         private void ShowForm1_Tick(object sender, EventArgs e)
  211.         {
  212.             if (this.Opacity == 1)  //如果窗体透明度达到 1
  213.             {
  214.                 this.ShowForm1.Stop();
  215.             }
  216.             else  //透明度小于 1
  217.             {
  218.                 this.Opacity = this.Opacity + 0.1; //透明度递增
  219.             }
  220.         }
  221.         private void HideForm1_Tick(object sender, EventArgs e)
  222.         {
  223.             this.Opacity = this.Opacity - 0.1; //透明度不等于 0
  224.             if (this.Opacity == 0) //透明度等于 0
  225.             {
  226.                
  227.                 this.HideForm1.Stop();
  228.                 Application.Exit();
  229.             }
  230.         }
  231.         private void label13_Click(object sender, EventArgs e)
  232.         {
  233.         }
  234.         private void timer1_Tick(object sender, EventArgs e)
  235.         {
  236.             label13.Text = DateTime.Now.ToString();
  237.         }
  238.      
  239.      
  240.     }
  241. }