/// <summary> /// 获取本学院导师 /// </summary> /// <param name="id"></param> /// <returns></returns> public JsonResult GetModelBuycenterid(int id) { List <ViewUserModelsGroup> users = new List <ViewUserModelsGroup>(); FollowServiceClient clientFoll = new FollowServiceClient(); ViewUserModelsGroup user = null; JsonResult js = new JsonResult(); List <ViewYogisModels> list = new List <ViewYogisModels>(); using (YogisModelsServiceClient client = new YogisModelsServiceClient()) { //返回个数 int count = 4; list = client.GetYogisModelsByCenterId(id, count); } for (int i = 0; i < list.Count; i++) { list[i].DisplayImg = CommonInfo.GetDisplayImg(list[i].DisplayImg); list[i].YogisDepict = list[i].YogisDepict.Length > 320 ? list[i].YogisDepict.Substring(0, 320) + "..." : list[i].YogisDepict; user = new ViewUserModelsGroup(); user.VmList = list[i]; user.FollowCount = clientFoll.GetFollowByCount(list[i].UID); users.Add(user); } js.Data = users; js.JsonRequestBehavior = JsonRequestBehavior.AllowGet; return(js); }
/// <summary> /// 属于机构的导师列表 /// </summary> /// <returns></returns> public List <ViewUserModelsGroup> Members(int id) { #region 属于机构的导师列表 List <ViewYogisModels> list = new List <ViewYogisModels>(); using (YogisModelsServiceClient client = new YogisModelsServiceClient()) { //返回个数 int count = 4; list = client.GetYogisModelsByCenterId(id, count); } List <ViewUserModelsGroup> users = new List <ViewUserModelsGroup>(); FollowServiceClient clientFoll = new FollowServiceClient(); ViewUserModelsGroup userModels = null; for (int i = 0; i < list.Count; i++) { list[i].DisplayImg = CommonInfo.GetDisplayImg(list[i].DisplayImg); if (!string.IsNullOrEmpty(list[i].YogisDepict)) { string tempdepict = NoHTML(list[i].YogisDepict); list[i].YogisDepict = tempdepict.Length > 320 ? tempdepict.Substring(0, 320) + "..." : tempdepict; } userModels = new ViewUserModelsGroup(); if (list[i].CountryID.Value != -1) { userModels.CountryName = dicclient.GetById(list[i].CountryID.Value).ItemName; } else { userModels.CountryName = dicclient.GetById(66).ItemName; } userModels.VmList = list[i]; //user.FollowCount = clientFoll.GetFollowByCount(list[i].UID); userModels.iFollow = method.iGetFollow(user.Uid, list[i].UID); users.Add(userModels); } return(users); // return Json(users,JsonRequestBehavior.AllowGet); // ViewBag.Members = users; #endregion }