123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.EvaluationManage;
- using EMIS.CommonLogic.CalendarManage;
- using EMIS.ViewModel;
- using Bowin.Common.Data;
- using Bowin.Common.Utility;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using System.Linq.Expressions;
- using EMIS.Entities;
- namespace EMIS.Web.Controllers.EvaluationManage.TeacherEvaluationCount
- {
- [Authorization]
- public class TeacherEvaluationCountController : Controller
- {
- public ITeacherEvaluationCountServices TeacherEvaluationCountServices { get; set; }
- public ISchoolYearServices SchoolYearServices { get; set; }
- //
- // GET: /TeacherEvaluationCount/
- [HttpGet]
- public ActionResult List()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var departmentID = pararms.getExtraGuid("DepartmentDropdown"); //教研室
- var typeID = pararms.getExtraGuid("EvaluationTypeDropdown");//评价类型
- //var SchoolyearNumID = pararms.getExtraInt("ddlYear") == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");//年级
- var collegeID = pararms.getExtraGuid("cgCollege");//院系所
- var schoolyearID = pararms.getExtraGuid("SchoolYearDropdown"); //学年学期
- var result = TeacherEvaluationCountServices.GetTeacherView(configuretView, collegeID, schoolyearID, typeID, departmentID, (int)pararms.page, (int)pararms.rows);
- return Json(result);
- }
- #region 2.0 列表信息导出
- [HttpPost]
- public ActionResult Excel()
- {
- try
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- //var subjectID = Request.Form["ddlExaminationSubject"].ParseStrTo<Guid>();
- var collegeID = Request.Form["cgCollege"].ParseStrTo<Guid>();
- var schoolyearID = Request.Form["SchoolYearDropdown"].ParseStrTo<Guid>();
- //var classID = Request.Form["cgClassmajor"].ParseStrTo<Guid>();
- //var examinationTypeID = Request.Form["cgExamination"].ParseStrTo<Guid>();
- var typeID = Request.Form["EvaluationTypeDropdown"].ParseStrTo<Guid>();
- var departmentID = Request.Form["DepartmentDropdown"].ParseStrTo<Guid>();
- //var SchoolyearNumID = Request.Form["ddlYear"].ParseStrTo<int>() == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL ? null : Request.Form["ddlYear"].ParseStrTo<int>();
- //var standardID = Request.Form["ddlStandard"].ParseStrTo<int>() == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL ? null : Request.Form["ddlStandard"].ParseStrTo<int>();
- var dt = TeacherEvaluationCountServices.GetTeacherView(configuretView, collegeID, schoolyearID, typeID, departmentID).Select(x => new
- {
- x.SchoolyearCode,
- x.TeacherNo,
- x.TeacherName,
- x.NeedEvaluationCount,
- x.CompleteCount,
- x.UncompletedCount
- }).ToTable();
- string[] liststring = { "学年学期", "教师工号", "教师名称", "需评人次", "已评人次", "未评人次" };
- //string[] liststring = { "评价编号", "课程名称", "评价类型 ", "被评教师号", "被评教师", "任务班名称", "参评类型 ", "已评次数" };
- neh.Export(dt, liststring, "教师评价人次");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Content("~/TeacherEvaluationCount/List").AddMenuParameter()
- });
- }
- catch (Exception ex)
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出失败,原因:" + ex.Message + "!",
- url = Url.Content("~/TeacherEvaluationCount/List").AddMenuParameter()
- });
- }
- }
- #endregion
- }
- }
|