예제 #1
0
 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)));
 }
예제 #2
0
 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);
 }
예제 #3
0
 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)));
 }
예제 #4
0
 public ActionResult CountRates(string data)
 {
     var list = JsonConvert.DeserializeObject<List<DormExam>>(data);
     var business = new DormExamBusiness(Db);
     return Json(business.CountRates(list));
 }
예제 #5
0
 public ActionResult Search(DormExamSearchCondition condition)
 {
     var business = new DormExamBusiness(Db);
     var json = JsonConvert.SerializeObject(business.SearchDormExam(condition));
     return Content(json);
 }
예제 #6
0
 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");
 }