Ejemplo n.º 1
0
 private static void ConnectionFailed(string msg)
 {
     //var data = Thread.GetDomain()
     //Debug.WriteLine(data.);
     //Debug.WriteLine(11111111111111111);
     Debug.WriteLine(Thread.CurrentThread.Name);
     DialogDisplayHelper.DisplayMessageBox(msg + "\n Retry Again", "Error", MessageBoxButton.YesNo,
                                           MessageBoxImage.Stop);
 }
Ejemplo n.º 2
0
        public async Task Login(object parameter)
        {
            await RunCommand(() => this.LoginIsRunning, async() =>
            {
                await Task.Delay(2000);
                var userName = UserName;
                var password = (parameter as IHavePassword).SecureString.UnsSecure();

                var response = WebConnect.PostData("user/login", new { Uname = userName, password });
                if (response.StatusCode == HttpStatusCode.OK)
                {
                    var jObject   = JObject.Parse(response.Content.ReadAsStringAsync().Result);
                    LogInFor.Data = jObject;
                    var win       = Application.Current.MainWindow;
                    new Main().Show();
                    win.Close();
                }
                else
                {
                    DialogDisplayHelper.DisplayMessageBox("Check Your PassWord And Username", "Login Failed",
                                                          MessageBoxButton.OK, MessageBoxImage.Question);
                }
            });
        }