public ActionResult GetTeacherVerticalResult(string teacherName, DateTime startTime, DateTime endTime)
 {
     var business = new DormExamBusiness(Db);
     var condition = new DormExamSearchCondition { DepartmentId = 0, MajorId = 0, Grade = "全部", ClassInfoId = 0, TeacherName = teacherName };
     var list = business.SearchDormExam(condition);
     var result = list.Where(u => u.Time <= endTime && u.Time >= startTime).ToList();
     return Content(JsonConvert.SerializeObject(business.CalculateTeacherVertical(result)));
 }
 public ActionResult GetTeacherHorizontalResult(int departmentId)
 {
     var business = new DormExamBusiness(Db);
     var condition = new DormExamSearchCondition { DepartmentId = departmentId, MajorId = 0, Grade = "全部", ClassInfoId = 0 };
     var json = JsonConvert.SerializeObject(business.CalculateTeacherHorizontal(business.SearchDormExam(condition)),
         DateTimeConverter);
     return Content(json);
 }
 public ActionResult GetStudentVerticalResult(int departmentId, int majorId, string grade, int classId, DateTime startTime, DateTime endTime)
 {
     var business = new DormExamBusiness(Db);
     var condition = new DormExamSearchCondition { DepartmentId = departmentId, MajorId = majorId, Grade = grade, ClassInfoId = classId };
     var list = business.SearchDormExam(condition);
     var result = list.Where(u => u.Time <= endTime && u.Time >= startTime).ToList();
     return Content(JsonConvert.SerializeObject(business.CalculateTeacherVertical(result)));
 }
 public ActionResult CountRates(string data)
 {
     var list = JsonConvert.DeserializeObject<List<DormExam>>(data);
     var business = new DormExamBusiness(Db);
     return Json(business.CountRates(list));
 }
 public ActionResult Search(DormExamSearchCondition condition)
 {
     var business = new DormExamBusiness(Db);
     var json = JsonConvert.SerializeObject(business.SearchDormExam(condition));
     return Content(json);
 }
 public ActionResult ExportExcel(string data)
 {
     var list = JsonConvert.DeserializeObject<List<DormExam>>(data);
     var business = new DormExamBusiness(Db);
     var stream = business.ListToExcel(list);
     //stream.Close();
     return File(stream, "application/vnd.ms-excel;charset=UTF-8", "temp.xls");
 }