123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using EMIS.CommonLogic.MinorManage.MinorPlanManage;
- using EMIS.Utility.FormValidate;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using EMIS.Utility;
- namespace EMIS.Web.Controllers.MinorManage.MinorPlanManage
- {
- [Authorization]
- public class MinorPlanApproveController : Controller
- {
- //
- // GET: /MinorPlanApprove/
- public IMinorPlanApproveServices MinorPlanApproveServices { get; set; }
- public ActionResult List()
- {
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var yearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
- var standardID = pararms.getExtraInt("StandardDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("StandardDictionaryDropDown");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var approvalStatus = pararms.getExtraInt("DictionaryApprovalStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryApprovalStatus");
- return this.Json(MinorPlanApproveServices.GetMinorPlanApplyViewGrid(configuretView, yearID, standardID, collegeID, approvalStatus, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 审批确定(批量)
- /// </summary>
- /// <param name="planApplicationIDs"></param>
- /// <param name="actionID"></param>
- /// <param name="comment"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Approve(string GradeMinorApplicationIDs, Guid actionID, string comment)
- {
- var GradeMinorApplicationIDList = GradeMinorApplicationIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- var curUserID = CustomPrincipal.Current.UserID;
- if (GradeMinorApplicationIDList.Count == 0)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "请选择至少一条记录进行审核。" });
- }
- try
- {
- MinorPlanApproveServices.Approve(GradeMinorApplicationIDList, curUserID, actionID, comment);
- return Json(new ReturnMessage { IsSuccess = true, Message = "审核成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "审核失败:" + ex.Message });
- }
- }
- /// <summary>
- /// 导出Excel
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- var GradeMinorApplicationID = Request.Form["GradeMinorApplicationID"];
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var yearID = Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>();
- var standardID = Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>();
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
- var approvalStatus = Request.Form["GrademinorStatusDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["GrademinorStatusDictionaryDropDown"].ParseStrTo<int>();
- List<Guid?> GradeMinorApplicationIDList = new List<Guid?>();
- if (GradeMinorApplicationID != "")
- {
- GradeMinorApplicationIDList = GradeMinorApplicationID.SplitIDString();
- }
- else
- {
- GradeMinorApplicationIDList = null;
- }
- var dt = MinorPlanApproveServices.GetMinorPlanApplyViewList(configuretView, yearID, standardID, collegeID, approvalStatus, GradeMinorApplicationIDList).Select(x => new
- {
- x.YearID,
- x.StandardCode,
- x.StandardName,
- x.CollegeName,
- x.StudentLimit,
- x.CreateTime,
- x.CreateUserName,
- x.ApprovalStatusName
- }).ToTable();
- string[] liststring = { "年级", "专业代码", "专业名称", RSL.Get("College"), "人数上限","申请时间",
- "申请人","状态"};
- neh.Export(dt, liststring, "辅修申请审核信息");
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- }
- }
|