private void AllStationEnableSearch_CheckedChanged(object sender, EventArgs e) { if (SearchStationStartDate.Value.Date > SearchStationEndDate.Value.Date) { MessageBox.Show("Invalid search information. Please check.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { if (StationEnableSearch.Checked) { SearchStationName.Enabled = true; SearchStationStartDate.Enabled = true; SearchStationEndDate.Enabled = true; } else { SearchStationName.Enabled = false; SearchStationStartDate.Enabled = false; SearchStationEndDate.Enabled = false; } STATIONNAME StationName = GetStationNameForSearch(SearchStationName.Text); TTCSLog.GetLogBySearchInformarion(StationName, SearchStationStartDate.Value, SearchStationEndDate.Value, StationEnableSearch.Checked); } }
private void InitializeInterface() { TTCSLog.CreateTTCSLog(TTCSLogGrid); StationSelection.SelectedIndex = 0; SearchStationName.SelectedIndex = 0; }
private HttpResponseMessage Operation(String SessionID) { XmlDocument myXml = new XmlDocument(); XPathNavigator xNav = myXml.CreateNavigator(); ReturnLogInformation InformationResult = TTCSLog.GetLogList(); List <InformationLogs> InformationList = (List <InformationLogs>)InformationResult.ReturnValue; XmlSerializer xmlSerializer = new XmlSerializer(typeof(InformationLogs[])); if (InformationList != null && InformationList.Count > 0) { using (var xs = xNav.AppendChild()) { xmlSerializer.Serialize(xs, InformationList.ToArray()); } return(new HttpResponseMessage() { Content = new StringContent(myXml.OuterXml, Encoding.UTF8, "text/xml") }); } else if (InformationList.Count == 0) { return(HostingHelper.ReturnError("There is no log information update. Please try again later.", myXml, xNav)); } else { return(HostingHelper.ReturnError(InformationResult.ReturnMessage, myXml, xNav)); } }
public static ReturnKnowType CreateStation(STATIONNAME StationName, String StationSessionID, Object ServerCallBackObject) { StationHandler ThisStation = KeeperData.FirstOrDefault(Item => Item.StationName == StationName); ReturnKnowType CreateSiteResult = ThisStation.CreateEngine(StationSessionID, ServerCallBackObject); if (ThisStation != null) { ThisStation.StationConnected(); } TTCSLog.NewLogInformation(StationName, DateTime.UtcNow, "Station name : " + StationName.ToString() + " has been created, Status ready and waiting for command.", LogType.COMMUNICATION, null); return(CreateSiteResult); }
private void StationChannel_Closed(object sender, EventArgs e) { IContextChannel ThisContext = (IContextChannel)sender; CallBackHandler.RemoveSiteConnection(ThisContext.SessionId); if (AstroData.IsStationConnected(ThisContext.SessionId)) { STATIONNAME ThisStation = AstroData.GetStationName(ThisContext.SessionId); TTCSLog.NewLogInformation(ThisStation, DateTime.UtcNow, "Station name : " + ThisStation.ToString() + " is now disconnceted.", LogType.COMMUNICATION, null); AstroData.SetStationDisconnected(ThisContext.SessionId); AstroData.StationDisconnected(ThisStation); } }
public static void UpdateInformation(STATIONNAME StationName, DEVICENAME DeviceName, String FieldName, Object Value, DateTime DataTimestamp) { INFORMATIONSTRUCT ThisField = GetInformationObject(StationName, DeviceName, FieldName); if (ThisField != null) { ThisField.Value = Value; ThisField.UpdateTime = DataTimestamp; UIHandler.DisplayToUI(StationName, DeviceName, ThisField); } else { TTCSLog.NewLogInformation(StationName, DateTime.UtcNow, "Station name : " + StationName.ToString() + " mapping error at: " + DeviceName + ".", LogType.FAILED, null); } }