frm管理员管理.cs

来自「c#can yin guan li xi tong」· CS 代码 · 共 76 行

CS
76 行
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace 餐饮管理系统
{
    public partial class frm管理员管理 : Form
    {
        public frm管理员管理()
        {
            InitializeComponent();
        }

        private void frm会员管理_Load(object sender, EventArgs e)
        {
            
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            string strUserID = textBox1.Text.Trim();
            string strPwd = textBox2.Text.Trim();
            string strRePwd = textBox3.Text.Trim();
            if (strUserID == "")
            {
                Utility.SetErr(textBox1, "帐号不能为空!");
                return;
            }
            if (strPwd == "" || strRePwd == "")
            {
                Utility.SetErr(buttonOK, "密码为能为空!");
                textBox2.Text = "";
                textBox3.Text = "";
                textBox2.Focus();
                return;
            }
            if (strPwd != strRePwd)
            {
                Utility.SetErr(textBox3, "两次密码输入不一致!请重新输入!");
                textBox2.Text = "";
                textBox3.Text = "";
                textBox2.Focus();
                return;
            }

            string strSql = string.Format("insert into dt_Admin(管理员,密码)values('{0}','{1}')", strUserID, strRePwd);
            if (DBserver.setCommNornQuey(strSql) > 0)
            {
                MessageBox.Show("注册成功!");
                this.Close();
            }
        }

        private void textBox3_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                buttonOK_Click(null, null);
            }
        }
        //退出管理员注册界面
        private void buttonCancle_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }
    }
}

⌨️ 快捷键说明

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