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 EMIS.Web.Controls;
- using Bowin.Common.Utility;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Data;
- namespace EMIS.Web.Controllers.EvaluationManage.MyEvaluation
- {
- [Authorization]
- public class MyEvaluationController : Controller
- {
- //
- // GET: /MyEvaluation/
- public IEvaluationAdviseServices evaluationAdviseServices { get; set; }
- public ISchoolYearServices schoolYearServices { get; set; }
- [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)
- {
- var schoolYearID = pararms.getExtraGuid("SchoolYearDropdown"); //学年学期
- var evaluationTableID = pararms.getExtraGuid("EvaluationTableDropdown"); //评价表
- var evaluationTypeID = pararms.getExtraGuid("EvaluationTypeDropdown"); //评价类型
- var coursematerialID = pararms.getExtraGuid("CoursematerialComboGrid");//课程
- var staffID = EMIS.Utility.FormValidate.CustomPrincipal.Current.UserID;//登录教师ID
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var result = evaluationAdviseServices.GetMyEvaluationViewGrid(configuretView, schoolYearID, coursematerialID, evaluationTableID, evaluationTypeID, staffID, (int)pararms.page, (int)pararms.rows);//, collegeID, departmentID
- return Json(result);
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- try
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var schoolYearID = Request.Form["SchoolyearDropdown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["SchoolyearDropdown"].ParseStrTo<Guid>(); //学年学期
- var evaluationTableID = Request.Form["EvaluationTableDropdown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["EvaluationTableDropdown"].ParseStrTo<Guid>();//pararms.getExtraGuid("EvaluationTableDropdown"); //评价表
- var evaluationTypeID = Request.Form["EvaluationTypeDropdown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["EvaluationTypeDropdown"].ParseStrTo<Guid>();//pararms.getExtraGuid("EvaluationTypeDropdown"); //评价类型
- var coursematerialID = Request.Form["CoursematerialComboGrid"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["CoursematerialComboGrid"].ParseStrTo<Guid>();//pararms.getExtraGuid("CollegeDropdown");//院系所
- //var departmentID = Request.Form["DepartmentDropdown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DepartmentDropdown"].ParseStrTo<Guid>();//pararms.getExtraGuid("DepartmentDropdown");//教研室
- var staffID = EMIS.Utility.FormValidate.CustomPrincipal.Current.UserID;
- //var myEvaluationID = Request.Form["MyEvaluationID"];
- //List<Guid?> myEvaluationIDList = new List<Guid?>();
- //if (myEvaluationID != "")
- //{
- // myEvaluationIDList = myEvaluationID.SplitIDString();
- //}
- //else
- //{
- // myEvaluationIDList = null;
- //}
- var dt = evaluationAdviseServices.GetMyEvaluationViewList(configuretView, schoolYearID, coursematerialID, evaluationTableID, evaluationTypeID, staffID).Select(x => new
- {
- x.SchoolyearCode,
- x.CourseName,
- x.EducationMissionClassName,
- x.EvaluationTypeName,
- x.EvaluationTableName,
- x.Remark
- }).ToTable();
- string[] liststring = { "学年学期", "课程名称", "任务班名称", "参评类型", "评价表名", "评语建议" };
- neh.Export(dt, liststring, "我的评价");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Content("~/MyEvaluation/List").AddMenuParameter()
- });
- }
- catch (Exception ex)
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出失败,原因:" + ex.Message + "!",
- url = Url.Content("~/MyEvaluation/List").AddMenuParameter()
- });
- }
- }
- }
- }
|