123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using EMIS.CommonLogic.ScoreManage;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using EMIS.Utility;
- using EMIS.ViewModel.ScoreManage;
- using EMIS.CommonLogic.EducationManagement;
- using EMIS.Utility.FormValidate;
- using EMIS.CommonLogic.EducationManage;
- namespace EMIS.Web.Controllers.ScoreManage
- {
- [Authorization]
- public partial class ScoreConvertController : Controller
- {
- public IScoreConvertByReplaceServices ScoreConvertByReplaceServices { get; set; }
- public IStudentScoreServices StudentScoreServices { get; set; }
- public IExecutablePlanServices ExecutablePlanServices { get; set; }
- public ActionResult ByReplaceList()
- {
- ViewBag.StartStatusID = ScoreConvertByReplaceServices.GetStartStatus();
- return View();
- }
- public ActionResult ByReplaceEdit(Guid? scoreConvertByReplaceID)
- {
- ScoreConvertByReplaceView scoreConvertByReplaceView = new ScoreConvertByReplaceView();
- if (scoreConvertByReplaceID.HasValue)
- {
- scoreConvertByReplaceView = ScoreConvertByReplaceServices.GetScoreConvertByReplaceView(scoreConvertByReplaceID);
- }
- return View(scoreConvertByReplaceView);
- }
- [HttpPost]
- public ActionResult ByReplaceList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var collegeID = pararms.getExtraGuid("cgbCollege");
- var yearID = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
- var standardID = pararms.getExtraInt("cbgStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("cbgStandard");
- var classmajorID = pararms.getExtraGuid("cbgClassmajor");
- var coursematerial = pararms.getExtraGuid("cbgCourse");
- var recordStatus = pararms.getExtraInt("ddlRecordStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlRecordStatus");
- return base.Json(ScoreConvertByReplaceServices.GetScoreConvertByReplaceViewGrid(configuretView, schoolyearID, collegeID, yearID,
- standardID, classmajorID, coursematerial, recordStatus, pararms.page, pararms.rows));
- }
- [HttpPost]
- public ActionResult ByReplaceExcel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var schoolyearID = Request.Form["ddlSchoolyear"].ParseStrTo<Guid>();
- var collegeID = Request.Form["cgbCollege"].ParseStrTo<Guid>();
- var yearID = Request.Form["ddlYear"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlYear"].ParseStrTo<int>();
- var standardID = Request.Form["cbgStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["cbgStandard"].ParseStrTo<int>();
- var classmajorID = Request.Form["cbgClassmajor"].ParseStrTo<Guid>();
- var coursematerial = Request.Form["cbgCourse"].ParseStrTo<Guid>();
- var recordStatus = Request.Form["ddlRecordStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlRecordStatus"].ParseStrTo<int>();
- var dt = ScoreConvertByReplaceServices.GetScoreConvertByReplaceViewList(configuretView, schoolyearID, collegeID, yearID,
- standardID, classmajorID, coursematerial, recordStatus)
- .Select(x => new
- {
- x.SchoolyearCode,
- x.CollegeName,
- x.StandardDesc,
- x.ClassmajorName,
- x.LoginID,
- x.Name,
- x.TargetCourseCode,
- x.TargetCourseName,
- x.TotalScore,
- x.SourceCourseCode,
- x.SourceCourseName,
- x.RecordStatusDesc
- }).ToTable();
- string[] liststring = {
- "学年学期", RSL.Get("College"), "专业", "班级", "学号", "姓名",
- "课程代码", "课程名称", "成绩", "原始课程代码", "原始课程名称", "状态"
- };
- neh.Export(dt, liststring, "替换认定列表" + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- [HttpPost]
- public ActionResult ByReplaceEdit(ScoreConvertByReplaceView scoreConvertByReplaceView)
- {
- try
- {
- ScoreConvertByReplaceServices.Save(scoreConvertByReplaceView);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败," + ex.Message
- });
- }
- }
- [HttpPost]
- public ActionResult ByReplaceDelete(string scoreConvertByReplaceIDs)
- {
- try
- {
- var scoreConvertByReplaceIDList = scoreConvertByReplaceIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- ScoreConvertByReplaceServices.Delete(scoreConvertByReplaceIDList);
- return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" });
- }
- catch (Exception ex)
- {
- return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败," + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult SourceCoursematerialList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var userID = pararms.getExtraGuid("cbgUserID");
- return Json(StudentScoreServices.GetFinallyScoreCoursematerialViewGrid(configuretView, userID ?? Guid.Empty, pararms.page, pararms.rows));
- }
- [HttpPost]
- public ActionResult SourceCoursematerialView(Guid userID, Guid coursematerialID)
- {
- try
- {
- var sourceView = StudentScoreServices.GetFinallyScoreView(userID, coursematerialID);
- return Json(new ReturnMessage<FinallyScoreView> { IsSuccess = true, Message = "", Data = sourceView });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- }
- }
- [HttpPost]
- public ActionResult TargetCoursematerialList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var userID = pararms.getExtraGuid("cbgUserID");
- return Json(ExecutablePlanServices.GetLastCoursematerialViewGrid(configuretView, userID ?? Guid.Empty, pararms.page, pararms.rows));
- }
- [HttpPost]
- public ActionResult ByReplaceSubmit(string scoreConvertByReplaceIDs)
- {
- try
- {
- var scoreConvertByReplaceIDList = scoreConvertByReplaceIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- ScoreConvertByReplaceServices.StartUp(scoreConvertByReplaceIDList, CustomPrincipal.Current.UserID);
- return base.Json(new ReturnMessage { IsSuccess = true, Message = "提交成功" });
- }
- catch (Exception ex)
- {
- return base.Json(new ReturnMessage { IsSuccess = false, Message = "提交失败," + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult ByReplaceApprove(string scoreConvertByReplaceIDs, Guid actionID, string comment)
- {
- try
- {
- var scoreConvertByReplaceIDList = scoreConvertByReplaceIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- ScoreConvertByReplaceServices.Approve(scoreConvertByReplaceIDList, CustomPrincipal.Current.UserID, actionID, comment);
- return base.Json(new ReturnMessage { IsSuccess = true, Message = "审核成功" });
- }
- catch (Exception ex)
- {
- return base.Json(new ReturnMessage { IsSuccess = false, Message = "审核失败," + ex.Message });
- }
- }
- }
- }
|