/// <summary> /// 根据用户编号随机获取系统访谈集合 /// </summary> /// <param name="userID">用户编号</param> /// <returns></returns> public IList<BiZ.Sys.SystemInterView> getInterView(String userID) { //获取当前登录用户的访谈集合 IList<BiZ.InterView.InterView> interviewList = BiZ.InterView.InterViewProvider.GetInterViews(userID, 0, 0); //根据访谈集合创建访谈对应的系统编号的集合 string[] alreadyanswered = new string[interviewList.Count]; for (int i = 0; i < interviewList.Count; i++) { alreadyanswered[i] = interviewList[i].SystemQuestionID; } //获取系统访谈,除去当前用户回答过的访谈 IList<BiZ.Sys.SystemInterView> systeminterviews = new SystemFuncController().GetSystemInterViewList("", alreadyanswered); return systeminterviews; }
public ActionResult InterView(String id) { #region metas version ViewData["jsversion"] = BiZ.Sys.RunStatus.JsVersion; ViewData["cssversion"] = BiZ.Sys.RunStatus.CSSVersion; ViewData["imageversion"] = BiZ.Sys.RunStatus.ImageVersion; ViewData["uploadpath"] = CBB.ConfigurationHelper.AppSettingHelper.GetConfig("UploadPath"); #endregion bool alreadylogin = isalreadylogin("Member"); String userid = HttpContext.User.Identity.Name; //如果访问ID为空,则访问自己的主页 if (id == null) { if (userid == null) return RedirectToAction("Error", "Error", new { errorno = "0" }); else id = userid; } #region 构造页面数据对象 Models.MemberFullDisplayObj memberDisplayObj = Models.DisplayObjProvider.getMemberFullDisplayObj(id); IList<BiZ.InterView.InterView> intviewlist = BiZ.InterView.InterViewProvider.GetInterViews(id, 0, 0); string[] alreadyanswered = new string[intviewlist.Count]; for (int i = 0; i < intviewlist.Count; i++) { alreadyanswered[i] = intviewlist[i].SystemQuestionID; } IList<BiZ.Sys.SystemInterView> systeminterviews = new SystemFuncController().GetSystemInterViewList("", alreadyanswered); //页面数据对象 Models.PageModels.MemberInterViewModel interviewmodel = new Models.PageModels.MemberInterViewModel( memberDisplayObj, intviewlist, systeminterviews); interviewmodel.UserID = userid; interviewmodel.MemberID = id; interviewmodel.AlreadyLogon = alreadylogin; #endregion return View(interviewmodel); }