美文网首页
2018-10-20

2018-10-20

作者: 邂逅8036 | 来源:发表于2018-10-20 21:43 被阅读0次

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;

    namespace WindowsFormsApplication1
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }
    private void Form1_Load(object sender, EventArgs e)
    {
    this.comboBox1.SelectedIndex = 0;
    }
    private void label1_Click(object sender, EventArgs e)
    {

        }
    
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            
        }
    
        private void button1_Click(object sender, EventArgs e)
        {
            if (this.comboBox1.SelectedItem.ToString() == "收银员")
            {
                if (this.textBox1.Text == "123456" && this.textBox2.Text == "123456")
                {
                    MessageBox.Show("收银员登录成功");
                }
                else
                {
                    MessageBox.Show("用户名或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            if (this.comboBox1.SelectedItem.ToString() == "库管员")
            {
                if (this.textBox1.Text == "admin" && this.textBox2.Text == "admin")
                {
                    MessageBox.Show("库管员登录成功");
                }
                else
                {
                    MessageBox.Show("用户名或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void button2_Click(object sender, EventArgs e)//退出
        {
            Application.Exit();
        }
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            
        }
       
    }
    

    }


    QQ图片20181021180131.pngQQ图片20181021180131.png
    QQ图片20181021180126.pngQQ图片20181021180126.png

    相关文章

      网友评论

          本文标题:2018-10-20

          本文链接:https://www.haomeiwen.com/subject/wxfvzftx.html