123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.GraduationManage.GraduationRequirement;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using EMIS.ViewModel.GraduationManage.GraduationRequirement;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using EMIS.Utility;
- namespace EMIS.Web.Controllers.GraduationManage.GraduationRequirement
- {
- [Authorization]
- public class GrademajorRequirementController : Controller
- {
- public IGrademajorRequirementServices GrademajorRequirementServices { get; set; }
- /// <summary>
- /// 类型学分页面(课程类型学分)
- /// </summary>
- /// <returns></returns>
- public ActionResult List()
- {
- return View();
- }
- /// <summary>
- /// 类型学分列表查询(课程类型学分)
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var gradSchoolyearID = pararms.getExtraGuid("GradSchoolyearDropdown");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- 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 educationID = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
- var learningformID = pararms.getExtraInt("DictionaryLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryLearningform");
- var learnSystem = pararms.getExtraString("DictionaryLearnSystem");
- return base.Json(GrademajorRequirementServices.GetGradGrademajorRequirementViewGird(configuretView, gradSchoolyearID, collegeID, yearID,
- standardID, educationID, learningformID, learnSystem, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 复制新增
- /// </summary>
- /// <param name="graduationRequirementID"></param>
- /// <returns></returns>
- public ActionResult CopyAdd(Guid graduationRequirementID)
- {
- GrademajorRequirementView grademajorRequirementView = new GrademajorRequirementView();
- grademajorRequirementView = GrademajorRequirementServices.GetGradGrademajorRequirementView(graduationRequirementID);
- return View("Edit", grademajorRequirementView);
- }
- /// <summary>
- /// 复制新增
- /// </summary>
- /// <param name="grademajorRequirementView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult CopyAdd(GrademajorRequirementView grademajorRequirementView)
- {
- grademajorRequirementView.GraduationRequirementID = Guid.Empty;
- return this.Edit(grademajorRequirementView);
- }
- /// <summary>
- /// 编辑(新增、修改,业务主键:年级专业)
- /// </summary>
- /// <param name="graduationRequirementID"></param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Edit(Guid? graduationRequirementID)
- {
- GrademajorRequirementView grademajorRequirementView = new GrademajorRequirementView();
- if (graduationRequirementID.HasValue && graduationRequirementID != Guid.Empty)
- {
- grademajorRequirementView = GrademajorRequirementServices.GetGradGrademajorRequirementView(graduationRequirementID);
- }
- return View(grademajorRequirementView);
- }
- /// <summary>
- /// 编辑(新增、修改,业务主键:年级专业)
- /// </summary>
- /// <param name="grademajorRequirementView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit(GrademajorRequirementView grademajorRequirementView)
- {
- try
- {
- GrademajorRequirementServices.GradGrademajorRequirementEdit(grademajorRequirementView);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败,原因:" + ex.Message + "。"
- });
- }
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="graduationRequirementIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Delete(string graduationRequirementIDs)
- {
- try
- {
- List<Guid?> list = graduationRequirementIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
- .Select(x => (Guid?)new Guid(x)).ToList();
- GrademajorRequirementServices.GradGrademajorRequirementDelete(list);
- return base.Json("删除成功。");
- }
- catch (Exception ex)
- {
- return base.Json("删除失败,原因:" + ex.Message);
- }
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var gradSchoolyearID = Request.Form["GradSchoolyearDropdown"] == DropdownList.SELECT_ALL.ToString() ? null : Request.Form["GradSchoolyearDropdown"].ParseStrTo<Guid>();
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
- 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 educationID = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
- var learningformID = Request.Form["DictionaryLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryLearningform"].ParseStrTo<int>();
- var learnSystem = Request.Form["DictionaryLearnSystem"].ToString();
- var dt = GrademajorRequirementServices.GetGradGrademajorRequirementViewList(configuretView, gradSchoolyearID, collegeID, yearID,
- standardID, educationID, learningformID, learnSystem)
- .Select(x => new
- {
- x.GraduatingSemesterCode,
- x.GrademajorCode,
- x.GrademajorName,
- x.FacultymajorNo,
- x.FacultymajorName,
- x.CollegeNo,
- x.CollegeName,
- x.SchoolyearID,
- x.SchoolcodeName,
- x.EnteringSchoolYearCode,
- x.StandardID,
- x.StandardCode,
- x.StandardName,
- x.EducationName,
- x.LearningformName,
- x.LearnSystem,
- x.OptionalCourseCredit,
- x.RequiredCredit,
- x.TotalCredit,
- x.SpecialCredit
- }).ToTable();
- string[] liststring = {
- "毕业学期", "年级专业编号", "年级专业名称", "院系专业编号", "院系专业名称",
- RSL.Get("CollegeCode"), RSL.Get("CollegeName"), "年级", "学期", "入学学年学期",
- "专业ID(Value)", "专业代码", "专业名称", RSL.Get("EducationID"), "学习形式",
- "学制", "选修学分", "必修学分", "总学分", "特定学分"
- };
- neh.Export(dt, liststring, "毕业专业学分信息" + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
-
- }
- }
|