public void ProcessSystemStatus(DataCenterTypes.SystemStatusType systemStatus) { using (var ssda = new SystemStatusDataAccess()) { ssda.Create(TypeHelper.Map2DB(systemStatus), 0); } }
public ActionResult GridData(int page, int rows, string[] _search, string sidx, string sord) { string[] ReqParams = { "Message", "MessageId", "MessageType", "Originator", "SystemStatus", "test", "MsgInOut", "TimeStamp" }; List <string> columns = new List <string>(); List <string> querys = new List <string>(); string tstamp = "-"; var fromDate = new DateTime(2000, 1, 1); var toDate = new DateTime(2200, 1, 1); for (int i = 0; i < ReqParams.Count(); i++) { if (ReqParams[i].Contains("TimeStamp")) { tstamp = Request.Params[ReqParams[i]]; if (tstamp != null) { var dates = tstamp.Split('-'); fromDate = DateTime.Parse(dates[0]); if (dates.Length == 1) { toDate = fromDate.AddDays(1); } else { toDate = DateTime.Parse(dates[1]); } } continue; } var tempValue = Request.Params[ReqParams[i]]; if (tempValue != null) { columns.Add(ReqParams[i]); querys.Add(tempValue); } } var lda = new SystemStatusDataAccess(context); var logs = lda.GetAllBetween(fromDate, toDate); var model = from entity in logs.OrderBy(sidx + " " + sord) select new { Message = entity.Message, MessageId = entity.MessageId, MessageType = entity.MessageType, Originator = entity.Originator, SystemStatus = entity.SystemStatus1, test = entity.test, MsgInOut = entity.MsgInOut.InOut, TimeStamp = entity.TimeStamp.ToString() }; return(Json(model.ToJqGridData(page, rows, null, querys.ToArray(), columns.ToArray()))); }
public void GetLastAspStatus(out int aspStatus, out TimeSpan aspSince) { using (var sda = new SystemStatusDataAccess()) { var aspst = sda.GetLastAspStatus(); aspStatus = 1; aspSince = TimeSpan.FromSeconds(0); if (aspst != null) { aspStatus = 0; aspSince = DateTime.UtcNow - aspst.TimeStamp; } } }
public void getLastStatus(out int status, out TimeSpan since) { using (var ssda = new SystemStatusDataAccess()) { var systemStatus = ssda.GetLastIncomingStatus(); status = 0; since = TimeSpan.FromSeconds(0); if (systemStatus != null) { status = systemStatus.SystemStatus1; since = DateTime.UtcNow - systemStatus.TimeStamp; } } }
public void ProcessAspHeartBeat(Common.HeartBeatMessage aspHb) { var sda = new SystemStatusDataAccess(); var sysst = new SystemStatus(); sysst.DDPVersionNum = "0"; sysst.Message = "ASP OK"; sysst.MessageId = "0"; sysst.MessageType = 0; sysst.Originator = "ASP"; sysst.schemaVersion = 0; sysst.SystemStatus1 = 0; sysst.test = 0; sysst.TimeStamp = DateTime.UtcNow; sda.Create(sysst, 0); }
public bool IsIdeOk() { using (var ssda = new SystemStatusDataAccess()) { var systemStatus = ssda.GetLastIncomingStatus(); if (DateTime.UtcNow - systemStatus.TimeStamp > TimeSpan.FromMinutes(30)) { return(false); } if (systemStatus.SystemStatus1 == 1) { return(false); } return(true); } }
/// <summary> /// Envia un mensaje de tipo SystemStatus /// </summary> /// <param name="msg"></param> private string SendSystemStatus(Message msg) { DataCenterLogic.DataCenterTypesIDE.SystemStatusType systemStatus = (DataCenterLogic.DataCenterTypesIDE.SystemStatusType)(msg.Body); //Send to IDE if (System.Configuration.ConfigurationManager.AppSettings["send2servers"] != "False") { systemStatus.test = DataCenterLogic.DataCenterTypesIDE.testType.Item0; ideClient.SystemStatus(systemStatus); log.Info("SendSystemStatus: systemStatus sent to IDE"); } //Guarda el mensaje en la base de datos using (var dao = new SystemStatusDataAccess()) { dao.Create(TypeHelper.Map2DB(systemStatus), 1); } log.Info("SystemStatus stored"); return(systemStatus.MessageId); }