示例#1
0
 private void imagePre_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     AdminMenu am = new AdminMenu();
     am.AdminName = AdminName;
     am.Show();
     this.Close();
 }
示例#2
0
        private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            try
            {
                string testWebService = new MyService().GetAdministrator().HelloWorld();
            }
            catch
            {
                MessageBox.Show("无法连接到服务器,请确保网络连接和ip(你输入的ip地址: " + App.ip + ")地址正确(正确ip地址示例:121.197.3.168:8080)");
                return;
            }

            ServiceAdministrator.AdministratorSoapClient serviceAdministrator = myService.GetAdministrator();
            string username = this.Textboxname.Text.ToString();
            string pwd = this.Passwordboxpwd.Password.ToString();
            if(serviceAdministrator.CheckAdministrator(username,pwd))
            {
                //new AdminMenu().Show();
                AdminMenu am = new AdminMenu();
                am.AdminName=username;
                am.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("用户名不存在或密码错误");
            }
        }
示例#3
0
 private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     string oldpwd = this.OldPassword.Password.ToString();
     string newPwd = this.NewPassword.Password.ToString();
     string newPwdAgain = this.NewPasswordAgain.Password.ToString();
     if (!newPwd.Equals(NewPasswordAgain))
         MessageBox.Show("两次密码输入不同");
     else
     {
         if (NewPasswordAgain.Equals(""))
             MessageBox.Show("新密码不能为空");
         else
         {
             bool result = myService.GetAdministrator().CheckAdministrator(AdminName,oldpwd);
             if(result)
             {
                 result = myService.GetAdministrator().ResetPassword(AdminName,newPwd);
                 if(result)
                 {
                     MessageBox.Show("密码修改成功");
                     AdminMenu am = new AdminMenu();
                     am.AdminName = AdminName;
                     am.Show();
                     this.Close();
                 }
             }
             else
                 MessageBox.Show("密码输入错误");
         }
     }
 }