/// <summary> /// 机构 /// </summary> /// <param name="page"></param> /// <param name="centertype"></param> /// <returns></returns> public ActionResult Index(int page = 1, string centertype = "0") { ViewBag.centertype = centertype; List <ViewCenters> list = new List <ViewCenters>(); int count = 0; list = client.GetCentersPageList(page, 15, centertype, out count); PagedList <ViewCenters> pagelist = new PagedList <ViewCenters>(list, page, 15, count); return(View(pagelist)); }
//学院首页 public ActionResult SchoolIndex(int page = 1) { List <ViewCenters> list = new List <ViewCenters>(); int count = 0; using (CentersServiceClient client = new CentersServiceClient()) { list = client.GetCentersPageList(page, 10, "1", out count); } PagedList <ViewCenters> pagelist = new PagedList <ViewCenters>(list, page, 10, count); return(View("SchoolIndex", pagelist)); }
/// <summary> /// 查询条件 /// </summary> /// <param name="iType">机构类型</param> /// <param name="urlContent">搜索内容</param> /// <returns></returns> public ActionResult Search(string iType, string urlContent = "", int page = 1) { int count = 0; string YogaTypeid = string.Empty; List <ViewCenters> centers = new List <ViewCenters>(); using (CentersServiceClient client = new CentersServiceClient()) { centers = client.GetCentersPageList(urlContent, 0, 0, iType, 1, 10, out count); } if (count != 0) { ViewBag.listGroup = centers; ViewBag.Count = count; } ViewBag.type = "jigou"; ViewBag.iType = iType; ViewBag.urlContent = urlContent; return(View()); }
/// <summary> /// 查找机构 /// </summary> /// <param name="text"></param> /// <param name="page"></param> /// <param name="size"></param> /// <returns></returns> public JsonResult GetCenter(string text, int page = 1, int size = 10) { //派别 int typeid = 0; //瑜伽类别 string id = "0"; //国家 int CountryID = 0; //省份 int ProvinceID = 0; //城市 int CityID = 0; //地区 int DistrictID = 0; int count = 0; List <ViewCenters> list = new List <ViewCenters>(); using (CentersServiceClient client = new CentersServiceClient()) { list = client.GetCentersPageList(text, DistrictID, CityID, ProvinceID, CountryID, typeid, id, page, size, out count); } PageResult <ViewCenters> pr = new PageResult <ViewCenters>(); pr.Objects = (from y in list select new ViewCenters() { CenterId = y.CenterId, CenterName = y.CenterName, CenterPortraint = y.CenterPortraint }).ToList(); pr.Code = 0; pr.Index = page; pr.PageSize = size; pr.RecordCount = count; return(Json(pr, JsonRequestBehavior.AllowGet)); }
// // GET: /Mechanism/ public ActionResult Index(int page = 1, string id = "0") { //派别 int typeid = 0; if (!string.IsNullOrEmpty(Request.Form["typeid"])) { typeid = Convert.ToInt32(Request.Form["typeid"]); } //瑜伽类别 if (!string.IsNullOrEmpty(Request.Form["centerclassid"])) { id = Request.Form["centerclassid"]; } //国家 int CountryID = 0; if (!string.IsNullOrEmpty(Request.Form["hidCountryID"])) { CountryID = Convert.ToInt32(Request.Form["hidCountryID"]); } //省份 int ProvinceID = 0; if (!string.IsNullOrEmpty(Request.Form["hidProvinceID"])) { ProvinceID = Convert.ToInt32(Request.Form["hidProvinceID"]); } //城市 int CityID = 0; if (!string.IsNullOrEmpty(Request.Form["hidCityID"])) { CityID = Convert.ToInt32(Request.Form["hidCityID"]); } //地区 int DistrictID = 0; if (!string.IsNullOrEmpty(Request.Form["hidDistrictID"])) { DistrictID = Convert.ToInt32(Request.Form["hidDistrictID"]); } List <ViewCenters> list = new List <ViewCenters>(); int count = 0; int pagesize = 5; using (CentersServiceClient client = new CentersServiceClient()) { list = client.GetCentersPageList("", DistrictID, CityID, ProvinceID, CountryID, typeid, id, page, pagesize, out count); } List <ViewCentersGroup> centergroups = new List <ViewCentersGroup>(); ViewCentersGroup centergroup = new ViewCentersGroup(); using (EvaluatesServiceClient eclient = new EvaluatesServiceClient()) { int rcount = 0; foreach (ViewCenters c in list) { rcount = 0; centergroup = new ViewCentersGroup(); centergroup.center = c; eclient.GetRecommendCount(c.CenterId, out rcount); centergroup.recommond = rcount; //派别 string typename = string.Empty; if (c.YogaTypeid != null) { string[] arrtypeid = c.YogaTypeid.Replace("|", "").Split(','); for (int i = 0; i < arrtypeid.Length; i++) { if (!String.IsNullOrEmpty(arrtypeid[i])) { typename += dicclient.GetYogaDicItemById(Convert.ToInt32(arrtypeid[i])).ItemName + ","; } } if (!String.IsNullOrEmpty(typename)) { typename = typename.Substring(0, typename.Length - 1); } } centergroup.Address = method.GetItemName(c.CountryID.Value) + "·" + method.GetItemName(c.ProvinceID.Value) + "·" + method.GetItemName(c.CityID.Value) + "·" + method.GetItemName(c.DistrictID.Value); centergroup.centertype = typename; centergroups.Add(centergroup); } } Webdiyer.WebControls.Mvc.PagedList <ViewCentersGroup> pagelist = new Webdiyer.WebControls.Mvc.PagedList <ViewCentersGroup>(centergroups, page, pagesize, count); if (Request.IsAjaxRequest()) { return(PartialView("IndexList", pagelist)); } return(View(pagelist)); }