123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- 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.EvaluationReport
- {
- [Authorization]
- public class EvaluationRecordController : Controller
- {
- public IEvaluationRecordServices EvaluationRecordServices { get; set; }
- public ISchoolYearServices SchoolYearServices { get; set; }
- //
- // GET: /EvaluationResult/评价记录
- #region 1.0 列表信息查询
- [HttpGet]
- public ActionResult RecordList()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- /// <summary>
- /// 列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult RecordList(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 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("EvaluationTableDropdown"); //评价表
- var evaluationTypeID = pararms.getExtraGuid("EvaluationTypeDropdown"); //评价类型
- var learningformID = pararms.getExtraInt("LearningformDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("LearningformDictionaryDropDown");
- var education = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
- var LearnSystem = pararms.getExtraString("DictionaryLearnSystem");
- var result = EvaluationRecordServices.GetEvaluationRecordViewGrid(configuretView, campusID, collegeID, standardID, classmajorID, schoolyearCodeID, schoolYearID, evaluationTableID, evaluationTypeID, learningformID, education, LearnSystem, staffID, (int)pararms.page, (int)pararms.rows);
- return Json(result);
- }
- #endregion
- #region 2.0 删除信息操作
- /// <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);
- }
- }
- #endregion
- #region 3.0 列表信息导出
- [HttpPost]
- public ActionResult Excel()
- {
- try
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var schoolYearID = Request.Form["SchoolYearDropdown"].ParseStrTo<Guid>(); //学年学期
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>(); //院系所
- var evaluationTableID = Request.Form["EvaluationTableDropdown"].ParseStrTo<Guid>();//评价表
- var evaluationTypeID = Request.Form["EvaluationTypeDropdown"].ParseStrTo<Guid>(); //评价类型
- var learningformID = Request.Form["LearningformDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["LearningformDictionaryDropDown"].ParseStrTo<int>();
- var education = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
- var LearnSystem = Request.Form["DictionaryLearnSystem"].ToString();
- var dt = EvaluationRecordServices.GetEvaluationRecordViewList(configuretView, schoolYearID, collegeID, evaluationTableID, evaluationTypeID, learningformID, education, LearnSystem).Select(x => new
- {
- x.SchoolyearCode,
- x.EvaluationSettingCode,
- x.EducationMissionClassName,
- x.B_EvaluationName,
- x.EvaluationTypeName,
- x.EvaluationCode,
- x.EvaluationName,
- x.EvaluationTableName,
- x.EvaluationTableTypeName,
- x.LimitMore,
- x.EvaluationCount
- }).ToTable();
- string[] liststring = { "学年学期", "评价编号", "任务班名称", "被评教师", "评价类型", "参评人编号", "参评人", "评价表名", "评价类型", "可评次数", "已评次数" };
- neh.Export(dt, liststring, "评价记录信息");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Content("~/EvaluationReport/List").AddMenuParameter()
- });
- }
- catch (Exception ex)
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出失败,原因:" + ex.Message + "!",
- url = Url.Content("~/EvaluationReport/List").AddMenuParameter()
- });
- }
- }
- #endregion
- #region 4.0 绑定参评类型
- [HttpPost]
- public ActionResult EvaluationTypeDropdownListBanid(Guid? evaluationTableID)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- //if (evaluationTableID == null)
- //{
- // List<DropdownListItem> list = EvaluationRecordServices.GetEvaluationTypeByTableIDList(evaluationTableID).OrderByDescending(o => o.CreateTime).Select(x => new DropdownListItem { Value = x.TypeID.ToString(), Text = x.Name }).ToList();
- //}
- DropdownListBindType dbt = new DropdownListBindType();
- List<DropdownListItem> list = new List<DropdownListItem>();
- if (evaluationTableID != null)
- {
- list = EvaluationRecordServices.GetEvaluationTypeByTableIDList(evaluationTableID).OrderByDescending(o => o.CreateTime).Select(x => new DropdownListItem { Value = x.TypeID.ToString(), Text = x.Name }).ToList();
- dbt = DropdownListBindType.None;
- }
- else
- {
- list = EvaluationRecordServices.GetEvaluationTypeByTableIDList(evaluationTableID).OrderByDescending(o => o.CreateTime).Select(x => new DropdownListItem { Value = x.TypeID.ToString(), Text = x.Name }).ToList();
- dbt = DropdownListBindType.SelectAll;
- }
- DropdownList.FormatDropdownItemList(dbt, list);
- return base.Json(list);
- }
- #endregion
- }
- }
|