1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.SupervisionManage;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using EMIS.CommonLogic.SystemServices;
- using Bowin.Common.Utility;
- using Bowin.Web.Controls.Mvc;
- using EMIS.ViewModel.SupervisionManage;
- using Bowin.Common.Data;
- using EMIS.Utility;
- namespace EMIS.Web.Controllers.SupervisionManage
- {
- [Authorization]
- public class SupEvaluationController : Controller
- {
- //
- // GET: /SupEvaluation/
- public ISupEvaluationServices SupEvaluationServices { get; set; }
- public IRoleServices IRoleServices { get; set; }
- [HttpGet]
- public ActionResult List()
- {
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("SchoolyearDropdown");
- var collegeID = pararms.getExtraGuid("DDCollegeDropdown");
- var startTimes = pararms.getExtraDateTime("txtStartDate");
- var endTimes = pararms.getExtraDateTime("txtEndDate");
- var SupervisionTypeID = pararms.getExtraInt("SupervisionType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SupervisionType"); ;
- var dataRange = IRoleServices.GetDataRange();
- return base.Json(SupEvaluationServices.GetSupEvaluationViewGrid(configuretView,schoolyearID, collegeID, startTimes, endTimes, SupervisionTypeID, dataRange, (int)pararms.page, (int)pararms.rows));
- }
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var selectedLessonRecordID = Request.Form["LessonRecordIDs"] ?? "";
- var selectedProjectRecordID = Request.Form["ProjectRecordIDs"] ?? "";
- var schoolyearID = Request.Form["Schoolyear"].ParseStrTo<Guid>();
- var collegeID = Request.Form["ddlCollege"].ParseStrTo<Guid>();
- var startTimes = Request.Form["txtStartDate"].ParseStrTo<DateTime>();
- var endTimes = Request.Form["txtEndDate"].ParseStrTo<DateTime>();
- var SupervisionTypeID = Request.Form["SupervisionType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["SupervisionType"].ParseStrTo<int>();
- var dataRange = IRoleServices.GetDataRange();
- List<SupEvaluationView> result;
- List<Guid> LessonRecordIDList = new List<Guid>();
- List<Guid> ProjectRecordIDList = new List<Guid>();
- if (selectedLessonRecordID!="")
- {
- LessonRecordIDList = selectedLessonRecordID.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- }
- if (selectedProjectRecordID!="")
- {
- ProjectRecordIDList = selectedProjectRecordID.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- }
- result = SupEvaluationServices.GetSupEvaluationViewGridList(configuretView,schoolyearID, collegeID, startTimes, endTimes, SupervisionTypeID, dataRange, LessonRecordIDList, ProjectRecordIDList);
- var dt = result.Select(x => new
- {
- x.SchoolyearCode,
- x.SupervisionCollegeName,
- x.UserName,
- x.SupervisionTypeName,
- x.CourseName,
- x.LessonDateStr,
- x.Advise,
- x.TotalScore
- }).ToTable();
- string[] liststring = { "学年学期", RSL.Get("College"), "督导对象", "督导类型", "课程名称", "评价日期", "评价建议", "评分" };
- neh.Export(dt, liststring, "督导评价");
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功!"
- });
- }
- public ActionResult SupEvaluationReport()
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- var dataRange = IRoleServices.GetDataRange();
- ViewBag.DataRange = dataRange;
- ViewBag.UserID = curUser.UserID.ToString();
- return View();
- }
- }
- }
|