public ActionResult AnomalousEventManagement(int currentPage = 1) { Response.Cache.SetOmitVaryStar(true); var req = new DatasQueryResultRequestBase() { CurrentPageIndex = currentPage }; var testTypes = _mtts.GetAllTestType().Datas.Count(); long resultCount = 0; for (int i = 1; i <= testTypes; i++) { var result = _anomalousEventManagementService.GetAnomalousEventManagementDatasBy(req); if (result.Succeed) { resultCount += result.TotalResultCount; } } var resp = new AnomalousEventManagementResponseViewModel(); resp.TotalResultCount = resultCount; if (resp.TotalResultCount > 0) { resp.Succeed = true; ViewData["TotalPages"] = resp.TotalPages; } else { TempData[WebConstants.MessageColor] = StyleConstants.RedColor; TempData[WebConstants.Message] = "无记录!"; } return(View()); }
/// <summary> /// 获得当天各个测试类型异常事件的数量 /// </summary> /// <returns></returns> public ActionResult GetAbnormalEventNumber() { var req = new DatasQueryResultRequestBase() { StartTime = DateTime.Now.AddDays(-1), EndTime = DateTime.Now }; //DateTime AbnormalEventSearchTime=DateTime.Now.Date; var GetAbnormalEventResult = _anomalousEventManagementService.GetAnomalousEventByTime(req); var model = new AbnormalEventNumberViewListModels(); var result = new List <AbnormalEventNumberViewModel>(); var testTypes = _mtts.GetAllTestType().Datas.Count(); for (int i = 1; i <= testTypes; i++) { var source = _mtts.GetAllTestType().Datas.Where(m => (int)m.Id == i).SingleOrDefault(); var item = new AbnormalEventNumberViewModel(); item.TestTypeName = source.Name; item.AbnormalEventNumber = GetAbnormalEventResult.Datas.Where(m => m.TestType == source.Name).Count(); result.Add(item); } model.AbnormalEventNumberViewModels = result; return(PartialView("GetAbnormalEventNumberPartial", model)); }
public ActionResult GetDataComparingQuerySearchBar() { int firstTestTypeId; int defaultChoiceTestTypeId; var resp = _mtts.GetAllTestType(); SaveMonitoringTestTypesSelectListItemsToViewData(1, WebConstants.MonitoringTestTypesKey, out firstTestTypeId); SaveMonitoringTestTypesSelectListItemsToViewData(Convert.ToInt32(resp.Datas.Last().Id), WebConstants.MonitoringTestTypesSecondKey, out defaultChoiceTestTypeId); int tmpMornitoringPointsPositionId; int tmpMornitoringPointsPositionIdSecond; SaveMonitoringPointsPositionSelectListItemsToViewData(firstTestTypeId, WebConstants.MonitoringPointsPositionKey, out tmpMornitoringPointsPositionId); SaveMonitoringPointsPositionSelectListItemsToViewData(defaultChoiceTestTypeId, WebConstants.MonitoringPointsPositionSecondKey, out tmpMornitoringPointsPositionIdSecond); SaveMonitoringPointsNumberSelectListItemsToViewData(WebConstants.MonitoringPointsNumberKey, tmpMornitoringPointsPositionId); SaveMonitoringPointsNumberSelectListItemsToViewData(WebConstants.MonitoringPointsNumberSecondKey, tmpMornitoringPointsPositionIdSecond); return(PartialView("DataComparingQuerySearchPartial")); }
/// <summary> /// 获得测试类型下拉列表 /// </summary> void SaveMonitoringTestTypesSelectListItemsToViewData(out int firstTestTypeId) { firstTestTypeId = 1; var resp = _mtts.GetAllTestType().Datas.Where(m => m.Name == "索力" || m.Name == "位移" || m.Name == "风速" || m.Name == "温度"); if (resp.Any()) { firstTestTypeId = Convert.ToInt32(resp.First().Id); } SaveSelectListItemCollectionToViewData(resp, WebConstants.MonitoringTestTypesKey, false); }
/// <summary> /// 获得测试类型下拉列表 /// </summary> void SaveMonitoringTestTypesSelectListItemsToViewData(out int firstTestTypeId) { firstTestTypeId = 1; var resp = _mtts.GetAllTestType(); if (resp.Datas.Count() > 0) { firstTestTypeId = Convert.ToInt32(resp.Datas.First().Id); } SaveSelectListItemCollectionToViewData(resp.Datas, WebConstants.MonitoringTestTypesKey, false); }
public IEnumerable <dynamic> Load(PreloadDataSetType type) { switch (type) { case PreloadDataSetType.MornitoringTestType: return(_mtts.GetAllTestType().Datas); case PreloadDataSetType.MonitoringPointsPositionType: return(_mpps.GetAllMonitoringPointsPosition().Datas); case PreloadDataSetType.MonitoringPointsNumberType: return(_mpns.GetAllMonitoringPointsNumber().Datas); default: throw new ApplicationException("Invalid preload type"); } }