Exemple #1
0
        /// <summary>
        /// 详细页面
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public IActionResult Detail(int id)
        {
            CaseBLL    caseBLL    = new CaseBLL();
            CaseEntity caseEntity = caseBLL.GetById(id);

            CaseTagCorrelationBLL caseTagCorrelationBLL = new CaseTagCorrelationBLL();

            caseEntity.caseTagEntities = caseTagCorrelationBLL.CaseTagListByCaseId(caseEntity.caseId);

            CaseStepBLL caseStepBLL = new CaseStepBLL();

            caseEntity.caseStepEntities = caseStepBLL.ListByCaseId(caseEntity.caseId);

            return(View(caseEntity));
        }
Exemple #2
0
        public JsonResult GetById([FromForm] string token, [FromForm] int caseId)
        {
            DataResult dr = new DataResult();

            try
            {
                CaseBLL    caseBLL    = new CaseBLL();
                CaseEntity caseEntity = caseBLL.GetById(caseId);

                CommentBLL commentBLL = new CommentBLL();
                caseEntity.commentCount = commentBLL.ListByTypeAndObjId((int)Entity.TypeEnumEntity.TypeEnum.案例, caseEntity.caseId).Count();

                EndorseBLL           endorseBLL      = new EndorseBLL();
                List <EndorseEntity> endorseEntities = endorseBLL.ListByTypeAndObjId((int)Entity.TypeEnumEntity.TypeEnum.案例, caseEntity.caseId);

                caseEntity.endorseCount = endorseEntities.Count();
                UserEntity userEntity = new UserEntity();
                if (!string.IsNullOrWhiteSpace(token))
                {
                    userEntity = this.GetUserByToken(token);
                    if (endorseEntities.ToList().Exists(it => it.userId == userEntity.userId))
                    {
                        caseEntity.isEndorse = true;
                    }
                }

                CaseStepBLL caseStepBLL = new CaseStepBLL();
                caseEntity.caseStepEntities = caseStepBLL.ListByCaseId(caseEntity.caseId);

                CaseTagCorrelationBLL caseTagCorrelationBLL = new CaseTagCorrelationBLL();
                caseEntity.caseTagEntities = caseTagCorrelationBLL.CaseTagListByCaseId(caseEntity.caseId);

                dr.code = "200";
                dr.data = caseEntity;
            }
            catch (Exception ex)
            {
                dr.code = "999";
                dr.msg  = ex.Message;
            }

            return(Json(dr));
        }