美文网首页
2018-10-16

2018-10-16

作者: M_5aec | 来源:发表于2018-10-16 11:52 被阅读0次

    1.登录界面的效果图

    image.png

    2. 登录界面实现的功能描述

    超市收银员登录方式,默认收银员登录。

    3. 登录界面各控件的参数设置

    pictureBox1

    属性
    image WindowsFormsApplacation
    SizeMode stretchImage

    label3

    属性
    Text 用户类型

    comboBox1

    属性
    DropDownStyle DropDownList
    items (集合)

    label1

    属性
    Text 用户名

    textBox1

    属性
    Maxlength 9

    label2

    属性
    Text 密码

    textBox2

    属性
    Password *

    linkLabel1

    属性
    Text 忘记密码?

    button1

    属性
    Text 登录

    button2

    属性
    Text 退出

    4. 重要方法描述

    设置默认角色为“收银员”


    image.png
    // 点击“登录”按钮则登录系统
    private void button1_Click(object sender, EventArgs e)
            {
                if (this.comboBox1.SelectedItem.ToString() == "收银员")
                {
                    if (this.textBox1.Text == "123456" && this.textBox2.Text == "654321")
                    {
                        MessageBox.Show("收银员登录成功");
                    }
                    else
                    {
                        MessageBox.Show("用户名或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                if (this.comboBox1.SelectedItem.ToString() == "库管员")
                {
                    if (this.textBox1.Text == "654321" && this.textBox2.Text == "123456")
                    {
                        MessageBox.Show("库管员登录成功");
                    }
                    else
                    {
                        MessageBox.Show("用户名或密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
    
            }
    

    5. 需完善的功能

    没有注册功能。

    相关文章

      网友评论

          本文标题:2018-10-16

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