addzhiwei_form.cs

来自「人力管理系统」· CS 代码 · 共 73 行

CS
73
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using BusinessLayer;
using Entity;


namespace rsMange
{
    public partial class AddZhiWei_Form : Form
    {
        Operate_zhiweiTable op_zhiwei = new Operate_zhiweiTable();
        Zhiwei zw = null;

        public AddZhiWei_Form()
        {
            InitializeComponent();
        }
        public AddZhiWei_Form(Zhiwei zw)
        {
            InitializeComponent();
            this.Text = "修改职位";
            this.label2.Text = "新职位名称:";
            this.txtZhiWei.Text = zw.ZhiWei;
            this.zw = zw;

        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            if (this.Text != "修改职位")
            {
                string Zhiwei = this.txtZhiWei.Text.Trim();
                int c = op_zhiwei.InsertZhiWei(Zhiwei);
                if (c > 0)
                {
                    MessageBox.Show("添加成功!", "提示信息");
                    this.Close();
                }
                else
                    MessageBox.Show("添加失败!", "提示信息");
            }
            else
            {
                zw.ZhiWei = this.txtZhiWei.Text.Trim();
                int c = op_zhiwei.UpdateZhiwei(zw);
                if (c > 0)
                {
                    MessageBox.Show("修改成功!", "提示信息");
                    this.Close();
                }
                else
                    MessageBox.Show("修改失败!", "提示信息");
                
            }

        }

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

        private void AddZhiWei_Form_Load(object sender, EventArgs e)
        {

        }
    }
}

⌨️ 快捷键说明

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