2018-10-20

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.png
QQ图片20181021180131.png

QQ图片20181021180126.png
QQ图片20181021180126.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容