Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        /// <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));
        }