Beispiel #1
0
        /// <summary>
        /// 登录按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void blogin_Click(object sender, EventArgs e)
        {
            ManagerInfo mi = new ManagerInfo();

            //判断
            if (tname.Text.Length != 0 && tpass.Text.Length != 0)
            {
                bool b = mib.CheckLogin(tname.Text, tpass.Text);
                if (b)
                {
                    MessageBox.Show("登录成功");
                    //初始化主窗体的时候 把登录的用户类型传递过去
                    FormMain fMain = new FormMain(mib.ReturnType());
                    this.Hide();
                    fMain.Show();
                }
                else
                {
                    MessageBox.Show("登录失败");
                }
            }
            else
            {
                MessageBox.Show("账号密码不匹配");
            }
        }