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

📄 formtreenode.cs

📁 数据库开发与实例(1+1混合数据库开发实例丛书)人事管理系统的源代码
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HRMan.SysOper
{
    public partial class FormTreeNode : Form
    {
        public FormTreeNode()
        {
            InitializeComponent();
            HRMan.SysOper.FormTreeNode.treenode = this;
        }

        private void FormTreeNode_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DataAccess DA = new DataAccess();
            switch (this.label1.Text)
            {
                case "请输入部门名称":
                    {
                        string s = "insert into SectionInfo (sName) values ('" + this.textBox1.Text.Trim() + "')";
                        string str = "select * from SectionInfo where sName='" + this.textBox1.Text.Trim() + "'";
                        if (DA.IsRead(str) == false)
                        {
                            DataAccess D = new DataAccess();
                            D.ExeSQL(s);
                            HRMan.SysOper.FormDepInfo.departinfo.FormDepInfo_Load(sender, e);
                        }
                        break;
                    }
               
                case "请输入新部门名称":
                    {
                        HRMan.SysOper.FormDepInfo.departinfo.treeView1.SelectedNode.Text = this.textBox1.Text;
                        string s = "update SectionInfo set sName='" + this.textBox1.Text.Trim() + "' where sId=" + int.Parse(HRMan.SysOper.FormDepInfo.departinfo.departID);
                        DataAccess D = new DataAccess();
                        D.ExeSQL(s); 
                        HRMan.SysOper.FormDepInfo.departinfo.FormDepInfo_Load(sender, e);
                        break;
                    }
                default:
                    {
                        break;
                    }
                case "请输入民族名称":
                    {
                        string s = "insert into RaceInfo (rName) values('" + this.textBox1.Text.Trim() + "')";
                        string str = "select * from RaceInfo where rName='" + this.textBox1.Text.Trim() + "'";
                        if (DA.IsRead(str) == false)
                        {
                            DataAccess d = new DataAccess();
                            d.ExeSQL(s);
                            HRMan.SysOper.FormOtherSetting.othersetting.InitListBox1();
                            
                        }
                        else
                        {
                            MessageBox.Show("你添加的民族已经存在!");
                        }
                        break;
                    }
                case "请输入职务名称":
                    {
                        string s = "insert into JobInfo (JName) values('" + this.textBox1.Text.Trim() + "')";
                        string str = "select * from JobInfo where JName='" + this.textBox1.Text.Trim() + "'";
                        if (DA.IsRead(str) == false)
                        {
                            DataAccess d = new DataAccess();
                            d.ExeSQL(s);
                            HRMan.SysOper.FormOtherSetting.othersetting.InitListBox2();
                        }
                        else
                        {
                            MessageBox.Show("你添加的职务已经存在!");
                        }
                        break;
                    }
                case "请输入职称名称":
                    {
                        string s = "insert into Title (tName) values('" + this.textBox1.Text.Trim() + "')";
                        string str = "select * from Title where tName='" + this.textBox1.Text.Trim() + "'";
                        if (DA.IsRead(str) == false)
                        {
                            DataAccess d = new DataAccess();
                            d.ExeSQL(s);
                            HRMan.SysOper.FormOtherSetting.othersetting.InitListBox3();
                        }
                        else
                        {
                            MessageBox.Show("你添加的职称已经存在!");
                        }
                        break;
                    }
            }
        }
    }
}

⌨️ 快捷键说明

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