public ActionResult GetServiceByQH(string QH, string Type, int Pageindex, int Listnum) { HYMSDTEntities context = new HYMSDTEntities(); ReturnModel2 reModel = new ReturnModel2(); if (!string.IsNullOrEmpty(QH)) { var list = _GetServiceList(Type); if (list != null) { int startRow = (Pageindex - 1) * Listnum; list = list.Where(i => i.S_QH == QH).Skip(startRow).Take(Listnum).ToList(); if (list.Count() > 0) { reModel.Add("List", list); reModel.Add("Total", _GetServiceList(Type).Count()); } else { reModel.ErrorMessage = "查询结果为空"; } } else { reModel.ErrorMessage = "暂无数据"; } } else { reModel.ErrorMessage = "缺少参数:行政区划"; } return(Json(reModel)); }
public ActionResult GetHealth(string Name, string Type, int Pageindex, int Listnum) { HYMSDTEntities context = new HYMSDTEntities(); ReturnModel2 reModel = new ReturnModel2(); var list = context.T_Health.Where(i => i.H_Name.Contains(Name) && i.H_Type == Type).ToList(); if (list.Count() > 0) { int startRow = (Pageindex - 1) * Listnum; reModel.Add("List", list.Skip(startRow).Take(Listnum)); reModel.Add("Total", list.Count()); } else { reModel.ErrorMessage = "暂无数据"; } return(Json(reModel)); }
public ActionResult GetLeisureTourismByName(string Name, string Type, int Pageindex, int Listnum) { HYMSDTEntities context = new HYMSDTEntities(); ReturnModel2 reModel = new ReturnModel2(); var list = _GetLeisureTourismList(Type); if (list != null) { int startRow = (Pageindex - 1) * Listnum; list = list.Where(i => i.LT_Name.Contains(Name)).Skip(startRow).Take(Listnum).ToList(); reModel.Add("List", list); reModel.Add("Total", _GetLeisureTourismList(Type).Count()); } else { reModel.ErrorMessage = "暂无数据"; } return(Json(reModel)); }
public ActionResult QueryData(string Name) { HYMSDTEntities context = new HYMSDTEntities(); ReturnModel2 reModel = new ReturnModel2(); if (!string.IsNullOrEmpty(Name)) { //休闲旅游 var lList = _GetLeisureTourismList("").Where(i => i.LT_Name.Contains(Name)); if (lList.Count() > 0) { reModel.Add("LeisureTourism", lList); } //生活服务 var sList = _GetServiceList("").Where(i => i.S_Name.Contains(Name)); if (sList.Count() > 0) { reModel.Add("Service", sList); } //公共交通 var tList = _GetTrafficList("").Where(i => i.T_Name.Contains(Name)); if (tList.Count() > 0) { reModel.Add("Traffic", tList); } var staList = _GetStationList().Where(i => i.Sta_Name.Contains(Name)); if (staList.Count() > 0) { reModel.Add("Station", staList); } } else { reModel.ErrorMessage = "请输入搜索的名字"; } return(Json(reModel)); }
public ActionResult GetTrafficByName(string Name, string Type, int Pageindex, int Listnum) { HYMSDTEntities context = new HYMSDTEntities(); ReturnModel2 reModel = new ReturnModel2(); int startRow = (Pageindex - 1) * Listnum; if (Type != "公交站点") { var list = _GetTrafficList(Type); if (list != null) { list = list.Where(i => i.T_Name.Contains(Name)).Skip(startRow).Take(Listnum).ToList(); reModel.Add("List", list); reModel.Add("Total", _GetTrafficList(Type).Count()); } else { reModel.ErrorMessage = "暂无数据"; } } else { var list = _GetStationList(); if (list != null) { list = list.Where(i => i.Sta_Name.Contains(Name)).Skip(startRow).Take(Listnum).ToList(); reModel.Add("List", list); reModel.Add("Total", _GetStationList().Count()); } else { reModel.ErrorMessage = "暂无数据"; } } return(Json(reModel)); }
public ActionResult GetBusLineById(string guid) { HYMSDTEntities context = new HYMSDTEntities(); ReturnModel2 reModel = new ReturnModel2(); Guid Id = new Guid(guid); var model = context.T_BusLine.First(i => i.BL_Guid == Id); reModel.Add("BusLine", model); var sList = from bs in context.T_BusLine_Station.Where(i => i.BL_Id == model.BL_Id) join s in context.T_Station on bs.Sta_Id equals s.Sta_Id select new { Sta_Id = s.Sta_Id, Sta_Name = s.Sta_Name, Sta_Geo = s.Sta_Geo, Sta_Guid = s.Sta_Guid, Bl_Id = bs.BL_Id }; reModel.Add("BusLineStation", sList.ToList()); return(Json(reModel)); }