예제 #1
0
        private void button2_Click(object sender, EventArgs e) //确认返回
        {
            this.Hide();
            sForm1_main f1 = new sForm1_main();

            f1.ShowDialog();
            this.Close();
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            login a = login.instance;

            if (textBox1.Text == "")
            {
                MessageBox.Show("请输入用户名");
            }
            else
            {
                if (textBox2.Text == "")
                {
                    MessageBox.Show("请输入密码");
                }
                else
                {
                    if (a.exist(textBox1.Text.ToString()))
                    {
                        if (a.check(textBox1.Text, textBox2.Text))
                        {
                            user_ifms.ID = textBox1.Text;
                            if (user_ifms.ID[0] == '5')//warehouse 管仓库5
                            {
                                wForm1_main p = new wForm1_main();
                                this.Hide();
                                p.ShowDialog();
                                this.Close();
                            }
                            else
                            if (user_ifms.ID[0] == '6')//管摊位信息登陆
                            {
                                sForm1_main p = new sForm1_main();
                                this.Hide();
                                p.ShowDialog();
                                this.Close();
                            }
                            else
                            if (user_ifms.ID[0] == '7')//管商家的人登陆
                            {
                                mForm1_main p = new mForm1_main();
                                this.Hide();
                                p.ShowDialog();
                                this.Close();
                            }
                            else
                            if (user_ifms.ID[0] == '8' || user_ifms.ID[0] == '9')//管理员工信息人事部登陆
                            {
                                staffForm1_main p = new staffForm1_main();
                                this.Hide();
                                p.ShowDialog();
                                this.Close();
                            }
                            else//商家登陆
                            {
                                this.Hide();
                                usermainpage pp = new usermainpage();
                                pp.ShowDialog();
                                this.Close();
                            }
                        }
                        else
                        {
                            MessageBox.Show("登录失败,请检查用户名和密码");
                        }
                    }
                    else
                    {
                        MessageBox.Show("用户名不存在");
                    }
                }
            }
        }