示例#1
0
        /// <summary>
        /// 跳转测试用
        /// </summary>
        private void TestLogin()
        {
            F_AdminForm adminForm = new F_AdminForm();

            adminForm.Show();
            adminForm.Dispose();
            this.Hide();
        }
示例#2
0
        /// <summary>
        /// 登录验证
        /// </summary>
        private void LoginFoemation()
        {
            if (textName.Text != "" & textPass.Text != "")
            {
                bool[] LoginRes = DALFunc.LoginChek(textName.Text.Trim(), textPass.Text.Trim());
                //bool[] LoginRes = new bool[2]; LoginRes[0] = true; LoginRes[1] = true;

                if (LoginRes[0])
                {
                    ModuleClass.UIData.Login_Name = textName.Text.Trim();
                    //ModuleClass.UIData.Login_n = (int)(this.Tag);
                    //this.Close();
                    if (LoginRes[1])
                    {
                        if (DialogResult.Yes == MessageBox.Show("您是否使用配置功能?", "通讯录", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                        {
                            F_AdminForm adminForm = new F_AdminForm();
                            adminForm.Show();
                            adminForm.Dispose();
                            this.Hide();
                        }
                        else
                        {
                            F_UserForm userform = new F_UserForm();
                            userform.Show();
                            userform.Dispose();
                            this.Hide();
                        }
                    }
                    else
                    {
                        F_UserForm userform = new F_UserForm();
                        userform.Show();
                        userform.Dispose();
                        this.Hide();
                    }
                }
                else
                {
                    MessageBox.Show("用户名或密码错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    textName.Text = "";
                    textPass.Text = "";
                }


                MessageBox.Show("用户名或密码错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                textName.Text = "";
                textPass.Text = "";
            }
            else
            {
                MessageBox.Show("请将登录信息添写完整!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }