using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace HRManagerSystem
{
    public partial class HelpDocumentForm : Form
    {
        public HelpDocumentForm()
        {
            InitializeComponent();
        }
        string path = "";

        string curr = Directory.GetCurrentDirectory();
        private void HelpDocumentForm_Load(object sender, EventArgs e)
        {
           richtxt_content.LoadFile(curr+@"/document/staff.txt", RichTextBoxStreamType.PlainText);
           toolStripButton2.Enabled = false ;
          
        }
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
           
            switch(treeView1.SelectedNode.Name)
            {
                case "0":
                    path = curr+@"/document/staff.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "1":
                    path = curr + @"/document/departm.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "2":
                    path = curr + @"/document/user.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "3":
                    path = curr + @"/document/staffinfo.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "4":
                    path = curr + @"/document/jiangcheng.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "5":
                    path = curr + @"/document/staff.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "6":
                    path = curr + @"/document/fuli.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "7":
                    path = curr + @"/document/ryremove.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "8":
                    path = curr + @"/document/kaoping.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "9":
                    path = curr + @"/document/train.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "10":
                    path = curr + @"/document/stafftj.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "11":
                    path = curr + @"/document/departinfo.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "12":
                    path = curr + @"/document/departde.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "13":
                    path = curr + @"/document/userm.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
                case "14":
                    path = curr + @"/document/userpwd.txt";
                    richtxt_content.LoadFile(path, RichTextBoxStreamType.PlainText);
                    break;
            
            }
            
            
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("当前没有可用的打印机资源！", "提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        int s = 1;
        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            panel1.Hide();
            if (s == 1)
            {
                toolStripButton2.Enabled = true;
                toolStripButton4.Enabled = false;
                s = s + 1;
            }
        } 
      
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            panel1.Show();
            if (s == 2)
            {
                toolStripButton4.Enabled = true;
                toolStripButton2.Enabled = false;
                s = 1;

            }
        }

       
    }
}
