Ejemplo n.º 1
0
        public object GetAnswerHistoryDetial(BaseBaneModel bane)
        {
            if (!ModelState.IsValid)
            {
                return(OperateContext.Current.RedirectWebApi(
                           WebResultCode.Exception, "参数验证失败", null));
            }
            //返回数据
            List <AnswerHistoryResultModel> baneResult = operateContext.bllSession.Bane_HistoryScore.GetAnswerHistoryList(SysPermissSession.ChangeIdByGuid(bane.userid));

            if (null == baneResult)
            {
                return(OperateContext.Current.RedirectWebApi(WebResultCode.Exception, "数据获取失败", ""));
            }
            return(OperateContext.Current.RedirectWebApi(WebResultCode.Ok, "数据获取成功", baneResult));
        }
Ejemplo n.º 2
0
        public object GetAnswer(BaseBaneModel bane)
        {
            if (!ModelState.IsValid)
            {
                return(OperateContext.Current.RedirectWebApi(
                           WebResultCode.Exception, "参数验证失败", null));
            }
            //返回数据
            BaneHomeAnswerModel baneResult = operateContext.bllSession.Bane_User.GetAnswerDAL(SysPermissSession.ChangeIdByGuid(bane.userid));

            if (baneResult == null)
            {
                return(OperateContext.Current.RedirectWebApi(WebResultCode.Ok, "系统没有查询到答题记录~", ""));
            }
            return(OperateContext.Current.RedirectWebApi(WebResultCode.Ok, "成功获取数据~", baneResult));
        }
Ejemplo n.º 3
0
        public object GetBaneDetection(BaseBaneModel bane)
        {
            if (!ModelState.IsValid)
            {
                return(OperateContext.Current.RedirectWebApi(WebResultCode.Exception, "参数验证失败~", null));
            }
            //返回数据
            BaneDetectionModel baneResult = operateContext.bllSession.Bane_User.GetBaneDetectionByID(SysPermissSession.ChangeIdByGuid(bane.userid));

            if (baneResult == null)
            {
                return(OperateContext.Current.RedirectWebApi(WebResultCode.Exception, "数据获取失败~", null));
            }
            return(OperateContext.Current.RedirectWebApi(WebResultCode.Ok, "数据获取成功~", baneResult));
        }
Ejemplo n.º 4
0
        public object GetMyMessage(BaseBaneModel bane)
        {
            //1:定期检测提前3天提醒,超期还未检测则一直提醒,直到检测
            //2:(针对管控人员)每周答题提醒,从周4开始没做题则开始提醒,直到答题并合格
            if (!ModelState.IsValid)
            {
                return(OperateContext.Current.RedirectWebApi(
                           WebResultCode.Exception, "参数验证失败", null));
            }
            //返回数据
            List <BaneMyMessageModel> baneResult = new List <BaneMyMessageModel>();
            //1.在线答题提醒
            BaneMyMessageModel model = operateContext.bllSession.Bane_HistoryScore.GetAnswerContentByID(SysPermissSession.ChangeIdByGuid(bane.userid));

            if (model != null)
            {
                baneResult.Add(model);
            }
            //2.定期检测提醒
            model = operateContext.bllSession.Bane_User.GetDetectionContentByID(bane.userid);
            if (model != null)
            {
                baneResult.Add(model);
            }
            return(OperateContext.Current.RedirectWebApi(WebResultCode.Ok, "数据获取成功", baneResult));
        }
Ejemplo n.º 5
0
        public object GetAnswerIntegral(BaseBaneModel bane)
        {
            if (!ModelState.IsValid)
            {
                return(OperateContext.Current.RedirectWebApi(
                           WebResultCode.Exception, "参数验证失败", null));
            }
            //返回数据
            AnswerIntegralModel baneResult = operateContext.bllSession.Bane_IntegralScoreDetial.GetIntegralScoreById(SysPermissSession.ChangeIdByGuid(bane.userid));

            if (baneResult == null)
            {
                return(OperateContext.Current.RedirectWebApi(WebResultCode.Exception, "数据获取失败~", ""));
            }
            return(OperateContext.Current.RedirectWebApi(WebResultCode.Ok, "数据获取成功~", baneResult));
        }
Ejemplo n.º 6
0
        public object SubRandomAnswer(SubmitAnswerModel bane)
        {
            if (!ModelState.IsValid)
            {
                return(OperateContext.Current.RedirectWebApi(
                           WebResultCode.Exception, "参数验证失败", null));
            }
            //返回数据
            int core;
            int score = operateContext.bllSession.Bane_QuestionInfo.CheckAnswer(bane.options, SysPermissSession.ChangeIdByGuid(bane.userid), out core);

            //更新答题次数
            HCQ2_Model.Bane_User user = operateContext.bllSession.Bane_User.Select(s => s.user_guid == bane.userid).FirstOrDefault();
            int num = user.the_num + 1, tcore = user.user_total + core;

            operateContext.bllSession.Bane_User.Modify(new HCQ2_Model.Bane_User {
                the_num = num, user_total = tcore
            }, s => s.user_guid == bane.userid, "the_num", "the_score");
            string title = (score > 89) ? "恭喜您通过考核,每周只有第一次合格才能获得积分~" : "很遗憾您未通过考核~";

            return(OperateContext.Current.RedirectWebApi(WebResultCode.Ok, title, score));
        }