public List <DayOverviewDetailResponseItem> GET(int selectedDayListingID) { using (var eFactory = new jctmEntities()) { return(eFactory.WEBAPI_getDayOverviewDetailSP(selectedDayListingID).ToList().Select(a => new DayOverviewDetailResponseItem { AvgTemp = a.AvgTemp, Hour = a.HourPart }).ToList()); } }
public void GET(double humidity) { using (var eFactory = new jctmEntities()) { var humidityItem = eFactory.Humidities.Create(); humidityItem.Humidity1 = humidity; eFactory.Humidities.Add(humidityItem); eFactory.SaveChanges(); } }
public void GET(double temperature) { using (var eFactory = new jctmEntities()) { var temp = eFactory.Temperatures.Create(); temp.Temperature1 = temperature; eFactory.Temperatures.Add(temp); eFactory.SaveChanges(); } }
public DashboardResponseItem GET() { using (var eFactory = new jctmEntities()) { var result = eFactory.WEBAPI_getLatestTemperatureSP().FirstOrDefault(); if (result == null) { return(new DashboardResponseItem()); } return(new DashboardResponseItem { Latest_RecordedTime = result.Modified, Latest_Temperature = result.Temperature, CurrentDay_HighTemperature = result.Max.HasValue ? Math.Round(result.Max.Value, 0) : 0.0, CurrentDay_LowTemperature = result.Min.HasValue ? Math.Round(result.Min.Value, 0) : 0.0, }); } }
public List <DayOverviewListingResponseItem> GET() { using (var eFactory = new jctmEntities()) { var result = eFactory.WEBAPI_getDayOverviewListingSP().ToList(); var response = new List <DayOverviewListingResponseItem>(); foreach (var item in result) { var rItem = new DayOverviewListingResponseItem { ID = item.ID, AvgTemp = Math.Round(item.AverageTemp, 0), Day = item.Day, MaxTemp = Math.Round(item.HighTemp, 0), MinTemp = Math.Round(item.LowTemp, 0) }; response.Add(rItem); } return(response); } }
public void GET() { using (var eFactory = new jctmEntities()) { eFactory.Database.ExecuteSqlCommand("EXEC dbo.SQL_runNightlyJobsSP"); } }