/// <summary> /// 点评 /// </summary> /// <param name="page"></param> /// <param name="centertype"></param> /// <returns></returns> public ActionResult IndexEval(int page = 1, string centertype = "0") { ViewBag.centertype = centertype; List <ViewEvaluatesGroup> listGroupMsg = new List <ViewEvaluatesGroup>(); List <ViewEvaluates> list = new List <ViewEvaluates>(); int count = 0; using (EvaluatesServiceClient evalclient = new EvaluatesServiceClient()) { list = evalclient.GetEvaluatesPageList(page, 15, out count); } foreach (var item in list) { ViewEvaluatesGroup model = new ViewEvaluatesGroup(); model.entity = item; ViewYogaUser usermodel = clientUser.GetYogaUserById(item.FromUid.Value); if (usermodel != null) { model.FromUser = usermodel.NickName; } ViewCenters center = client.GetById(item.ToUid.Value); if (center != null) { model.CetnerName = center.CenterName; } listGroupMsg.Add(model); } PagedList <ViewEvaluatesGroup> pagelist = new PagedList <ViewEvaluatesGroup>(listGroupMsg, page, 15, count); return(View(pagelist)); }
/// <summary> /// 会馆名称 /// </summary> /// <param name="CenterId"></param> /// <returns></returns> public string GetCenterName(string CenterId) { string ReturnValue = string.Empty; if (!string.IsNullOrEmpty(CenterId)) { ViewCenters entity = new ViewCenters(); if (CenterId.IndexOf(',') != -1) { string[] ids = CenterId.Split(','); foreach (var i in ids) { entity = new ViewCenters(); entity = cenclient.GetById(Convert.ToInt32(i)); if (entity != null) { ReturnValue += entity.CenterName + ","; } } } else { entity = cenclient.GetById(Convert.ToInt32(CenterId.Trim())); if (entity != null) { ReturnValue = entity.CenterName; } } } return(ReturnValue); }