Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/04/08 17:33:44 (16 years ago)
Author:
aleitner
Message:

Handled exeption if server not online (#380)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerConsole.cs

    r831 r912  
    3030using HeuristicLab.Hive.Contracts.Interfaces;
    3131using HeuristicLab.Hive.Contracts.BusinessObjects;
     32using HeuristicLab.Hive.Contracts;
    3233
    3334namespace HeuristicLab.Hive.Server.Console {
     
    4041      InitializeComponent();
    4142      tbIp.Text = "10.20.53.1";
     43      tbPort.Text = "9000";
    4244    }
    4345
     
    5355    /// <param name="e"></param>
    5456    private void btnLogin_Click(object sender, EventArgs e) {
    55       if (ipIsValid()) {
     57      if (isValid()) {
    5658        string newIp = tbIp.Text;
    5759        newIp = newIp.Replace(" ", "");
     
    6870
    6971
    70     private static bool ipIsValid() {
    71      
     72    private bool isValid() {
     73      if ((tbUserName.Text != "") &&
     74          (tbPwd.Text != "") &&
     75          (tbIp.Text != "") &&
     76          (tbPort.Text != "")) {
     77        try {
     78          IJobManager jobManager =
     79        ServiceLocator.GetJobManager();
     80          ResponseList<Job> jobs = jobManager.GetAllJobs();
     81          jobs = jobManager.GetAllJobs();
     82        }
     83        catch (Exception ex) {
     84          lblError.Text = "Server not online";
     85          return false;
     86        }
     87        return true;
     88      }
    7289      // TODO IP-Adress validation
    73       return true;
     90      return false;
    7491    }
    7592
Note: See TracChangeset for help on using the changeset viewer.