Ejemplo n.º 1
0
        //����¼����ť�ĵ����¼�
        private void btnLogin_Click(object sender, EventArgs e)
        {
            bool isValidUser = false;   //��ʶ�Ƿ�Ϊ�Ϸ��û�

            string message = "";

            if (ValidateInput())           //�����ж��û��������Ƿ���������
            {
                //��֤�û��Ƿ�Ϸ��ķ���
                isValidUser = ValidateUser(txtID.Text, txtPwd.Text, cboType.Text, ref message);

                //����ǺϷ����û��ʹ�����Ӧ�Ĵ���
                if (isValidUser)
                {
                    UserHelper.loginId = txtID.Text;        //��������û����浽��̬������
                    UserHelper.loginType = cboType.Text;    //��ѡ��ĵ�¼���ͱ��浽��̬������

                    if (cboType.Text == "����Ա")
                    {
                        //����ǹ���Ա��ת����Ӧ��������
                        MainForm main = new MainForm();
                        main.ShowDialog();
                        this.Visible = false;//���ش���
                    }
                    else if (cboType.Text == "��ƱԱ")
                    {
                        //����ǹ���Ա��ת����Ӧ��������
                        MainForm main = new MainForm();
                        main.ShowDialog();
                        this.Visible = false;//���ش���
                    }
                }
                else     //ʧ�ܸ�����ʾ
                {
                    MessageBox.Show(message, "������ʾ",
                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Ejemplo n.º 2
0
 //���ȡ����ť
 private void btnNO_Click(object sender, EventArgs e)
 {
     MainForm main = new MainForm();
     main.Show();
     this.Close();//�رմ��˳�����
 }