Esempio n. 1
0
        void enter(string login)
        {
            List <string> data = connector.enter(login);

            this.Visible = false;
            switch (data[0])
            {
            case "0":
                adminForm admin = new adminForm(connector);
                admin.ShowDialog();
                break;

            case "1":
                doctor doctorShow = new doctor(data[1]);
                doctorShow.ShowDialog();
                break;

            case "2":
                patient patientShow = new patient(data[1], connector);
                patientShow.ShowDialog();
                break;
            }
            this.Visible  = true;
            textBox1.Text = "";
            textBox2.Text = "";
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string account  = textBox1.Text;
            string password = Encrypt.MD5Encrypt32(textBox2.Text);

            if (radioButton1.Checked)
            {
                switch (AccountCheck(account, password, "patientAccount"))
                {
                case 0:
                    //  MessageBox.Show("验证成功");
                    if (IsFreeze(account) == 0)
                    {
                        patient ap = new patient(account);
                        ap.ShowDialog();
                    }
                    else
                    {
                        ReleaseFreezeApplication rfp = new ReleaseFreezeApplication();
                        rfp.ShowDialog();
                    }
                    break;

                case 1:
                    MessageBox.Show("账号不存在");
                    break;

                case 2:
                    MessageBox.Show("密码错误");
                    break;
                }
            }
            else if (radioButton2.Checked)
            {
                switch (AccountCheck(account, password, "doctorAccount"))
                {
                case 0:
                    // MessageBox.Show("验证成功");
                    doctor d = new doctor(account);
                    d.ShowDialog();
                    break;

                case 1:
                    MessageBox.Show("账号不存在");
                    break;

                case 2:
                    MessageBox.Show("密码错误");
                    break;
                }
            }
            else if (radioButton3.Checked)
            {
                switch (AccountCheck(account, password, "adminAccount"))
                {
                case 0:
                    admin adm = new admin(this);
                    adm.ShowDialog();
                    break;

                case 1:
                    MessageBox.Show("账号不存在");
                    break;

                case 2:
                    MessageBox.Show("密码错误");
                    break;
                }
            }
        }