Example #1
0
        private bool UserLogin(string userid)
        {
            this.CloseAllDialog();
            this.InitTimer();

            UploadInfo ui = new UploadInfo();
            Member m = ui.MemberAuth(userid);
            MyMsgBox mb = new MyMsgBox();

            if (m == null)
            {
                mb.ShowMsg("核对用户信息失败!", 1);
            }
            else
            {
                if (m.StrMobileNo.Length == 0)
                {
                    Login login = new Login(userid, this);
                    login.TopMost = true;
                    //         this.Controls.Add(login);
                    if (DialogResult.Yes == login.ShowDialog(this))
                    {
                        GlobalVariables.isUserLogin = true;
                        GlobalVariables.LoginUserId = userid;
                        GlobalVariables.M = m;
                        return true;
                    }
                    else
                    {
                        mb.ShowMsg("登录失败!\n请先绑定手机!", 1);
                    }
                }
                else
                {
                    GlobalVariables.isUserLogin = true;
                    GlobalVariables.LoginUserId = userid;
                    GlobalVariables.M = m;
                    return true;
                }
            }
            return false;
        }
 private bool UserLogin(string userid)
 {
     UploadInfo ui = new UploadInfo();
     Member m = ui.MemberAuth(userid);
     MyMsgBox mb = new MyMsgBox();
     if (m == null)
     {
         mb.ShowMsg("无效的用户!", 2);
         return false;
     }
     else
     {
         if (m.StrMobileNo.Length == 0)
         {
             Login login = new Login(userid, null);
             login.Location = new Point(30, 50);
             login.TopMost = true;
             this.Visible = false;
             //         this.Controls.Add(login);
             if (DialogResult.Yes == login.ShowDialog(par))
             {
                 GlobalVariables.isUserLogin = true;
                 GlobalVariables.LoginUserId = userid;
                 GlobalVariables.M = m;
                 this.DialogResult = DialogResult.Yes;
                 return true;
             }
             else
             {
                 mb.ShowMsg("登录失败!\n请先绑定手机!", 2);
                 this.Visible = true;
                 return false;
             }
         }
         else
         {
             GlobalVariables.isUserLogin = true;
             GlobalVariables.LoginUserId = userid;
             GlobalVariables.M = m;
             this.DialogResult = DialogResult.Yes;
             return true;
         }
     }
 }