public ActionResult Check() { Connect(); bool isAlive = proxy.AreYouAlive(); if (isAlive) { ViewBag.Alive = "BROTHER IS ALIVE."; } else { ViewBag.Alive = "BROTHER IS NOT ALIVE"; } return(View("Index")); }
private string ConnectToBrother() { TableHelper table = new TableHelper(); try { IBrotherConnection proxy = Connect(); proxy.AreYouAlive(); response = "Instance 0 is alive."; table.AddEvidence(new EvidenceEntity(response)); } catch (Exception e) { response = "Instance 0 is not alive."; table.AddEvidence(new EvidenceEntity(response, e.Message)); } return(response); }