public ActionResult ExpertScore(int topicid = 5) { ViewBag.Result = false; ViewBag.Message = string.Empty; BLL.SR.SR_TOPIC.Entity model = BLL.SR.SR_TOPIC.Instance.GetEntityByKey <BLL.SR.SR_TOPIC.Entity>(topicid); BLL.SR.SR_TOPIC_TYPE.Entity topicType = BLL.SR.SR_TOPIC_TYPE.Instance.GetEntityByKey <BLL.SR.SR_TOPIC_TYPE.Entity>(model.TOPIC_TYPE_ID); ViewBag.TopicTypeName = topicType.NAME; //参加的人员 List <BLL.SR.SR_TOPIC_USER.Entity> topicUsers = BLL.SR.SR_TOPIC_USER.Instance.GetTopicUserList(topicid); var libaleList = topicUsers.Where(x => x.IS_PERSON_LIABLE == 1).Select(x => new TopicUser() { USER_NAME = BLL.FW.BF_USER.Instance.GetStringValueByKey(x.USER_ID, "FULL_NAME") }); var libaleNoList = topicUsers.Where(x => x.IS_PERSON_LIABLE == 0).Select(x => new TopicUser() { USER_NAME = BLL.FW.BF_USER.Instance.GetStringValueByKey(x.USER_ID, "FULL_NAME") }); ViewBag.SelectLibaleUsers = libaleList.ToList(); ViewBag.SelectNoLibaleUsers = libaleNoList.ToList(); #region 加载课题评审规则 var subItemList = BLL.SR.SR_TOPIC_SUB_ITEM.Instance.GetList <BLL.SR.SR_TOPIC_SUB_ITEM.Entity>("TOPIC_ID=?", topicid); ViewBag.Subitems = SerializeObject(subItemList.ToList()); #endregion ModelState.Clear(); return(View(model)); }
/// <summary> /// 页面初始化 /// </summary> /// <param name="topicid"></param> /// <returns></returns> public ActionResult TopicScore(int topicid = 5) { ViewBag.Result = false; ViewBag.Message = string.Empty; BLL.SR.SR_TOPIC.Entity model = BLL.SR.SR_TOPIC.Instance.GetEntityByKey <BLL.SR.SR_TOPIC.Entity>(topicid); BLL.SR.SR_TOPIC_TYPE.Entity topicType = BLL.SR.SR_TOPIC_TYPE.Instance.GetEntityByKey <BLL.SR.SR_TOPIC_TYPE.Entity>(model.TOPIC_TYPE_ID); ViewBag.TopicTypeName = topicType.NAME; //参加的人员 List <BLL.SR.SR_TOPIC_USER.Entity> topicUsers = BLL.SR.SR_TOPIC_USER.Instance.GetTopicUserList(topicid); var libaleList = topicUsers.Where(x => x.IS_PERSON_LIABLE == 1).Select(x => new TopicUser() { USER_NAME = BLL.FW.BF_USER.Instance.GetStringValueByKey(x.USER_ID, "FULL_NAME") }); var libaleNoList = topicUsers.Where(x => x.IS_PERSON_LIABLE == 0).Select(x => new TopicUser() { USER_NAME = BLL.FW.BF_USER.Instance.GetStringValueByKey(x.USER_ID, "FULL_NAME") }); ViewBag.SelectLibaleUsers = libaleList.ToList(); ViewBag.SelectNoLibaleUsers = libaleNoList.ToList(); IList <BLL.SR.SR_TOPIC_EXPERT.Entity> allList = BLL.SR.SR_TOPIC_EXPERT.Instance .GetTopicExpertList(topicid); var opList = allList.Where(x => x.IS_SCORE == 1); if (opList != null && opList.Count() > 0) { ViewBag.AllScore = opList.Sum(x => x.SCORE); ViewBag.MaxScore = opList.Max(x => x.SCORE); ViewBag.MinScore = opList.Min(x => x.SCORE); ViewBag.AvgScore = ViewBag.AllScore / opList.Count(); } else { ViewBag.AllScore = 0; ViewBag.MaxScore = 0; ViewBag.MinScore = 0; ViewBag.AvgScore = 0; } ViewBag.IS_APPROVAL = model.IS_APPROVAL; ViewBag.APPROVAL_REMARK = model.APPROVAL_REMARK; ModelState.Clear(); return(View(model)); }
/// <summary> /// 编辑及新增 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Edit(int id = 5) { ViewBag.Result = false; ViewBag.Message = string.Empty; BLL.SR.SR_TOPIC.Entity model = new BLL.SR.SR_TOPIC.Entity(); if (id > 0) { model = BLL.SR.SR_TOPIC.Instance.GetEntityByKey <BLL.SR.SR_TOPIC.Entity>(id); if (model != null) { } else { ViewBag.Message = "课题不存在!"; model.ID = -1; } } #region 加载课题参与人员 var userList = BLL.SR.SR_TOPIC_USER.Instance.GetList <BLL.SR.SR_TOPIC_USER.Entity>("TOPIC_ID=?", id); ViewBag.SelectUser = userList; #endregion #region 加载下拉列表 DataTable dt = BLL.SR.SR_TOPIC_TYPE.Instance.GetTable(); var obj = new List <object>(); foreach (DataRow dr in dt.Rows) { obj.Add( new { id = dr["ID"], pId = dr["PARENT_ID"], name = dr["NAME"].ToString(), value = Convert.ToInt32(dr["ID"]) }); } ViewBag.TypeSelect = SerializeObject(obj); #endregion ModelState.Clear(); return(View(model)); }