Exemplo n.º 1
0
        public JsonResult GetSubmittedCountByQuestionnaireId(string name, Guid?questionnaireId, Guid?departmentId, int isSubmit)
        {
            JsonResult result         = new JsonResult();
            int        submittedCount = 0;
            int        employeeCount  = 0;

            try
            {
                submittedCount = questionnaireService.GetSubmittedCountByQuestionnaireId(name, questionnaireId, departmentId, isSubmit);
                if (isSubmit == -1)
                {
                    employeeCount = employeeService.GetEmployeeCount(name, departmentId, Guid.Empty);
                }
                else if (isSubmit == 1)
                {
                    employeeCount = submittedCount;
                }
                else if (isSubmit == 0)
                {
                    employeeCount  = submittedCount;
                    submittedCount = 0;
                }
                log.Info("查询成功");
            }
            catch (Exception e)
            {
                log.Error(e.Message);
            }
            finally
            {
                result = Json(new { code = 0, msg = "获取提交人数成功", submittedCount = submittedCount, employeeCount = employeeCount }, JsonRequestBehavior.AllowGet);
            }
            return(result);
        }