czygl.cs

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using GongZi.GongZiClass;
namespace GongZi
{
    public partial class czygl : Form
    {
        public czygl()
        {
            InitializeComponent();
        }
        DBOperate operate = new DBOperate();//创建数据库操作对象
        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();//关闭窗体
        }

        private void frmOperator_Load(object sender, EventArgs e)
        {
            string getUser =//创建SQL字符串
                "select UserName as '用户名',UserPwd as '密码',UserPower as '权限' from  tb_User";
            operate.BindDataGridView(dataGridView1,getUser);//绑定到DataGridView控件
            dataGridView1.Columns[0].Width = 88;//设置列宽度
            dataGridView1.Columns[1].Width = 85;//设置列宽度
            dataGridView1.Columns[2].Width = 88;//设置列宽度
            comboBox1.SelectedIndex = 0;//设置默认选择项
        }
	/// download by http://www.codefans.net
        private void 增加ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                txtOUser.Enabled = true;//启用文本框控件
                txtOPwd.Enabled = true;//启用文本框控件
                comboBox1.Enabled = true;//启用ComboBox控件
                string str =//创建SQL字符串
                    "select count(*) from tb_User where UserName='"+txtOUser.Text.Trim()+"'";
                int i = operate.HumanNum(str);//得到记录数量
                if (i > 0)
                {
                    MessageBox.Show("操作员存在!", "提示",//弹出消息对话框
                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;//退出事件
                }
                else
                {
                    if (txtOUser.Text.Trim() == "" || txtOPwd.Text.Trim() == "")
                    {
                        MessageBox.Show("信息不完整!", "提示",//弹出消息对话框
                            MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;//退出事件
                    }
                    else
                    {
                        string InsertSql =//创建SQL字符串
后面还有 84 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。