Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 public void Load()
 {
     try
     {
         mHelper        = new DBDevelopClientWebApi.DevelopServiceHelper();
         mHelper.Server = ServerAddress;
         if (!mHelper.Server.StartsWith("http://"))
         {
             mHelper.Server = "http://" + mHelper.Server;
         }
         if (mHelper.Login(ServerUserName, ServerPassword))
         {
             IsConnected = true;
             Databases   = mHelper.QueryDatabase().Select(e => e.Name).ToList();
             if (Databases.Count > 0)
             {
                 CurrentDatabase = Databases[0];
             }
         }
         else
         {
             IsConnected = false;
             CommandManager.InvalidateRequerySuggested();
             MessageBox.Show("Logging server failed!");
         }
         OnPropertyChanged("ConnectString");
     }
     catch (Exception ex)
     {
         IsConnected = false;
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
 private void loginb_Click(object sender, RoutedEventArgs e)
 {
     mHelper.Server = serverIp.Text;
     mHelper.Login("Admin", "Admin");
 }