123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using Bowin.Common.Exceptions;
- using Bowin.Common.Utility;
- using Bowin.Web.Controls.Mvc;
- using EMIS.CommonLogic.EvaluationManage;
- using EMIS.ViewModel;
- using EMIS.ViewModel.EvaluationManage;
- using EMIS.Web.Controls;
- using Bowin.Common.Data;
- using EMIS.CommonLogic.CalendarManage;
- using EMIS.CommonLogic.EducationManagement;
- using EMIS.ViewModel.EvaluationManage.EvaluationEnter;
- using System.Text;
- using System.Collections;
- using EMIS.Utility;
- using Bowin.Common.JSON;
- using EMIS.Entities;
- using System.Text.RegularExpressions;
- namespace EMIS.Web.Controllers.EvaluationManage.EvaluationTeacherScore
- {
- [Authorization]
- public class EvaluationTeacherScoreController : Controller
- {
- //
- // GET: /EvaluationTeacherScore/教师评价
- public IEvaluationTeacherScoreServices EvaluationTeacherScoreServices { get; set; }
- public ISchoolYearServices SchoolYearServices { get; set; }
- public IEvaluationTypeServices EvaluationTypeServices { get; set; }
- [HttpGet]
- public ActionResult List()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- var EvaluationType = EvaluationTeacherScoreServices.GetEvaluaitonTableTypeID();
- ViewBag.EvaluationType = EvaluationType;
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- //var classmajorID = pararms.getExtraGuid("ClassmajorDropdown"); //班级名称
- //var schoolyearCodeID = pararms.getExtraInt("SchoolyearDictionaryDropDown");//年级
- //var campusID = pararms.getExtraGuid("CampusDropdown");//校区
- var collegeID = pararms.getExtraGuid("CollegeDropdown");//院系所
- var departmentID = pararms.getExtraGuid("DepartmentDropdown");
- //var standardID = pararms.getExtraInt("StandardDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("StandardDictionaryDropDown");//专业名称
- //var staffID = pararms.getExtraGuid("StaffComboGrid");//被评教师
- var schoolYearID = pararms.getExtraGuid("SchoolYearDropdown"); //学年学期
- var evaluationTableID = pararms.getExtraGuid("EvaluationTypeDropdown"); //参评类型
- var evaluationIntTypeID = pararms.getExtraGuid("EvaluationIntTypeDropdown"); //评价类型
- var result = EvaluationTeacherScoreServices.GetEvaluationTeacherScoreViewGrid(configuretView, schoolYearID, evaluationIntTypeID, evaluationTableID, collegeID, departmentID, (int)pararms.page, (int)pararms.rows);
- return Json(result);
- }
- [HttpPost]
- public ActionResult EvaluationTypeDropdownListBanid(DropdownListBindType? bindType)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- List<DropdownListItem> list = EvaluationTypeServices.GetEvaluationTypeViewList(configuretView, null, null).OrderByDescending(o => o.CreateTime).Select(x => new DropdownListItem { Value = x.IsStudent.ToString(), Text = x.Name }).ToList();
- DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
- DropdownList.FormatDropdownItemList(dbt, list);
- return base.Json(list);
- }
- #region 2.0 列表信息导出
- [HttpPost]
- public ActionResult Excel()
- {
- try
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();//院系所
- var departmentID = Request.Form["DepartmentDropdown"].ParseStrTo<Guid>();
- var schoolYearID = Request.Form["SchoolYearDropdown"].ParseStrTo<Guid>(); //学年学期
- var evaluationTableID = Request.Form["EvaluationTypeDropdown"].ParseStrTo<Guid>(); //参评类型
- var evaluationIntTypeID = Request.Form["EvaluationIntTypeDropdown"].ParseStrTo<Guid>(); //评价类型
- var dt = EvaluationTeacherScoreServices.GetEvaluationTeacherScoreViewList(configuretView, schoolYearID, evaluationIntTypeID, evaluationTableID, collegeID, departmentID).Select(x => new
- {
- x.TeacherNo,
- x.TeacherName,
- x.CourseName,
- x.CommentCount,
- x.Average,
- x.EducationMissionClassName,
- x.EvaluationTableTypeName,
- x.EvaluationIntTypeName,
- x.CollegeRanking,
- x.DepartmentRanking
- }).ToTable();
- string[] liststring = { "教师工号", "教师名称", "课程名称", "参评人次", "平均分", "任务班名称", "参评类型", "评价类型", RSL.Get("College")+"排名", "教研室排名" };
- //string[] liststring = { "评价编号", "课程名称", "评价类型 ", "被评教师号", "被评教师", "任务班名称", "参评类型 ", "已评次数" };
- neh.Export(dt, liststring, "教师评分");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Content("~/EvaluationTeacherScore/List").AddMenuParameter()
- });
- }
- catch (Exception ex)
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出失败,原因:" + ex.Message + "!",
- url = Url.Content("~/EvaluationTeacherScore/List").AddMenuParameter()
- });
- }
- }
- #endregion
- }
- }
|