Example #1
0
 private void LoginFactory_Sucess(object sender, HttpFactoryArgs<UserStateInfo> e)
 {
     loadingTip.Visibility = Visibility.Collapsed;
     var userInfo = e.Result;
     if (userInfo.UserState == 0)
     {
         var personalInfo = new PersonalInfo();
         personalInfo.IsSaveInfo = toggleUserInfo.IsChecked.Value;
         personalInfo.IsAutoLogin = toggleAutoLogin.IsChecked.Value;
         personalInfo.UserPassWord = PPTVData.Utils.DataCommonUtils.Encode(txtPassWord.Password, Utils.Constants.PasswordKey);
         personalInfo.UserStateInfo = e.Result;
         personalInfo.IsCurrentLogin = true;
         PersonalFactory.Instance.InsertRecord(personalInfo);
         if (NavigationService.CanGoBack)
             NavigationService.GoBack();
         if (LoginSucessHandler != null)
             LoginSucessHandler();
     }
     else
     {
         var response = string.Empty;
         switch (userInfo.UserState)
         {
             case 1:
                 response = "该用户名不存在"; break;
             case 2:
                 response = "密码错误"; break;
             case 3:
                 response = "该用户已锁定"; break;
             case 4:
                 response = "该用户已过期"; break;
             case 5:
                 response = "该用户已删除"; break;
             default:
                 response = "登录失败"; break;
         }
         TileUtils.CreateBasicToast(response);
     }
 }
Example #2
0
 private void LoginFactory_Sucess(object sender, HttpFactoryArgs<UserStateInfo> e)
 {
     progressRing.Visibility = Visibility.Collapsed;
     var userInfo = e.Result;
     if (userInfo.UserState == 0)
     {
         var personalInfo = new PersonalInfo();
         personalInfo.IsSaveInfo = ToggleUserInfo.IsOn;
         personalInfo.IsAutoLogin = ToggleAutoLogin.IsOn;
         personalInfo.UserPassWord = PPTVData.Utils.DataCommonUtils.Encode(TxtPassWord.Password, Utils.Constants.PasswordKey);
         personalInfo.UserStateInfo = e.Result;
         PersonalFactory.Instance.InsertRecord(personalInfo);
         Popup.IsOpen = false;
         if (LoginSucessHandler != null)
             LoginSucessHandler(this, new RoutedEventArgs());
     }
     else
     {
         var response = string.Empty;
         switch (userInfo.UserState)
         {
             case 1:
                 response = "该用户名不存在"; break;
             case 2:
                 response = "密码错误"; break;
             case 3:
                 response = "该用户已锁定"; break;
             case 4:
                 response = "该用户已过期"; break;
             case 5:
                 response = "该用户已删除"; break;
             default:
                 response = "登录失败"; break;
         }
         TileUtils.CreateToastNotifications(response);
     }
 }