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

📄 login2.cs

📁 超市POS收银系统c.rar
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace FOUPOS
{
    public partial class Login2 : Form
    {
        private int u_Type = 0;
        public Login2(int type)
        {
            InitializeComponent();
            u_Type = type;
        }
        private void Login2_Load(object sender, EventArgs e)
        {

        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtName.Text) || string.IsNullOrEmpty(txtPwd.Text))
            {
                MessageBox.Show("用户名或密码不能为空。");
            }
            else
            {
                POS.Model.FUser m_User = new POS.Model.FUser();
                POS.BLL.FUser b_User = new POS.BLL.FUser();
                m_User = b_User.GetModel(txtName.Text, txtPwd.Text);
                if (m_User == null)
                {
                    MessageBox.Show("用户名或密码错误,请重新登录。");
                    txtName.Text = null;
                    txtPwd.Text = null;
                    txtName.Focus();
                }
                else
                {

                    this.DialogResult = DialogResult.OK;
                    if (m_User.URight == 0)
                    {
                        if (u_Type == 0)
                        {
                            this.Hide();
                            Cash c = new Cash(m_User);
                            c.ShowDialog();
                        }
                        if (u_Type == 1)
                        {
                            MessageBox.Show("你不是管理员,不能登录后台管理。");
                        }
                    }
                    if (m_User.URight == 1)
                    {
                        if (u_Type == 0)
                        {
                            this.Hide();
                            Cash c = new Cash(m_User);
                            c.ShowDialog();
                        }
                        if (u_Type == 1)
                        {
                            this.Hide();
                            Form1 main = new Form1();
                            main.ShowDialog();
                        }
                    }
                }
            }
        }
    }
}

⌨️ 快捷键说明

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