123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- 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;
- using EMIS.Utility.FormValidate;
- namespace EMIS.Web.Controllers.EvaluationManage.EvaluationAdvise
- {
- [Authorization]
- public class EvaluationAdviseController : Controller
- {
- public IEvaluationRecordServices EvaluationRecordServices { get; set; }
- public IEvaluationAdviseServices EvaluationAdviseServices { get; set; }
- public IEvaluationEnterServices EvaluationEnterServices { get; set; }
- public IEvaluationTargetServices EvaluationTargetServices { get; set; }
- public IEvaluationProjectServices EvaluationProjectServices { get; set; }
- public IEvaluationTableServices EvaluationTableServices { get; set; }
- public IEvaluationNormServices EvaluationNormServices { get; set; }
- //public IEvaluationNeedServices EvaluationNeedServices { get; set; }
- public IEvaluationTypeServices EvaluationTypeServices { get; set; }
- public IEvaluationSettingServices EvaluationSettingServices { get; set; }
- public ISchoolYearServices SchoolYearServices { get; set; }
- Guid? educationMissionID = Guid.Empty;
-
- /// <summary>
- /// 评语建议页面
- /// </summary>
- /// <returns></returns>
- [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 collegeID = pararms.getExtraGuid("CollegeDropdown");//院系所
- var departmentID = pararms.getExtraGuid("DepartmentDropdown");//教研室
- var staffID = pararms.getExtraGuid("StaffDropdown");//教师
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var result = EvaluationAdviseServices.GetEvaluationAdviseViewGrid(configuretView, schoolYearID, collegeID, departmentID, 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 collegeID = Request.Form["CollegeDropdown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["CollegeDropdown"].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 = Request.Form["StaffDropdown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["StaffDropdown"].ParseStrTo<Guid>();//pararms.getExtraGuid("StaffDropdown");//教师
- var dt = EvaluationAdviseServices.GetEvaluationAdviseViewList(configuretView, schoolYearID, collegeID, departmentID, evaluationTableID, evaluationTypeID, staffID).Select(x => new
- {
- x.UserCodes,
- x.UserNames,
- x.CourseName,
- x.EducationMissionClassName,
- x.EvaluationTypeName,
- x.EvaluationTableName,
- x.Remark
- }).ToTable();
- string[] liststring = { "教师编号", "教师名称", "课程名称", "任务班名称", "参评类型", "评价表名", "评语建议" };
- //string[] liststring = { "评价编号", "课程名称", "评价类型 ", "被评教师号", "被评教师", "任务班名称", "参评类型 ", "已评次数" };
- neh.Export(dt, liststring, "评语建议");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Content("~/EvaluationAdvise/List").AddMenuParameter()
- });
- }
- catch (Exception ex)
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出失败,原因:" + ex.Message + "!",
- url = Url.Content("~/EvaluationAdvise/List").AddMenuParameter()
- });
- }
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="ids"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Delete(string ids)
- {
- try
- {
- var list = ids.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(s => Guid.Parse(s)).ToList();
- EvaluationRecordServices.Delete(list);
- return base.Json("删除成功。");
- }
- catch (Exception ex)
- {
- return base.Json("删除失败,原因:" + ex.Message);
- }
- }
- }
- }
|