public JsonResult ShowBedInfo(string bedId) { BedDto retVal = null; //long bedId = 44; string logMsg = String.Format("Home/ShowBedInfo for BedId: {0}", bedId); Logging.LogTrace(logMsg); try { UtcGetRequest getRequest = new UtcGetRequest(); getRequest.Url = "http://localhost:1762"; getRequest.Action = String.Format("/CallCenter/fred/bed/{0}.xml", bedId); UtcResponse response = WebCommon.GetUtcRequest(getRequest); if (response.Success == true) { if (!String.IsNullOrEmpty(response.Xml)) { retVal = XmlHelper.DeSerializeObj <BedDto>(response.Xml); } else { logMsg += ", ERROR: The XML response is null or empty: " + getRequest.Url + getRequest.Action; Logging.LogError(logMsg); } } else { logMsg += ", ERROR: " + getRequest.Url + getRequest.Action + " " + response.StatusCode + " " + response.ErrorMessage; Logging.LogError(logMsg); } } catch (Exception ex) { logMsg += ", EXCEPTION: " + ex.Message; Logging.LogError(logMsg, ex); } return(Json(retVal, JsonRequestBehavior.AllowGet)); }
public BedDto GetBed(string sessionKey, string bedId) { BedDto retVal = new BedDto(); long id = 0; long.TryParse(bedId, out id); retVal.Id = id; if (id == 1) { retVal.Poc = "12N"; retVal.Room = "1001"; retVal.Bed = "A"; retVal.Extension = "1201"; } else { retVal.Poc = "Poc-" + bedId; } return retVal; }