Ejemplo n.º 1
0
 private void OnLogin(object sender, RoutedEventArgs e)
 {
     GlobalTrackService.GlobalTrackServicev1Client client = new GlobalTrackServicev1Client();
     var loginInfo =  client.Login(TbUser.Text.ToLower(), TbPassword.Text);
     if (string.IsNullOrEmpty(loginInfo.SessionId))
     {
         MessageBox.Show(loginInfo.ErrorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     else
     {
         UserContext.Service = client;
         UserContext.Session = loginInfo.SessionId;
         UserContext.Password = TbPassword.Text;
         UserContext.UserName = TbUser.Text.ToLower();
         this.Close();
     }
 }
Ejemplo n.º 2
0
        private void OnLogin(object sender, RoutedEventArgs e)
        {
            GlobalTrackService.GlobalTrackServicev1Client client = new GlobalTrackServicev1Client();
            var loginInfo = client.Login(TbUser.Text.ToLower(), TbPassword.Text);

            if (string.IsNullOrEmpty(loginInfo.SessionId))
            {
                MessageBox.Show(loginInfo.ErrorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            else
            {
                UserContext.Service  = client;
                UserContext.Session  = loginInfo.SessionId;
                UserContext.Password = TbPassword.Text;
                UserContext.UserName = TbUser.Text.ToLower();
                this.Close();
            }
        }