123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- 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.ScoreManage;
- using EMIS.ViewModel.ScoreManage;
- using Bowin.Common.Utility;
- using EMIS.Utility;
- using Bowin.Common.Data;
- using EMIS.Utility.FormValidate;
- namespace EMIS.Web.Controllers.ScoreManage
- {
- [Authorization]
- public partial class ScoreConvertController : Controller
- {
- //
- // GET: /ScoreConvertByApply/
- public IScoreConvertByApplyServices scoreConvertByApplyServices { get; set; }
- public ActionResult ByApplyList()
- {
- ViewBag.StartStatusID = scoreConvertByApplyServices.GetStartStatus();
- return View();
- }
- [HttpPost]
- public ActionResult ByApplyList(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(scoreConvertByApplyServices.GetScoreConvertByApplyViewGrid(configuretView, schoolyearID, collegeID, yearID,
- standardID, classmajorID, coursematerial, recordStatus, pararms.page, pararms.rows));
- }
- public ActionResult StudentByApplyList()
- {
- ViewBag.StartStatusID = scoreConvertByApplyServices.GetStartStatus();
- return View();
- }
- [HttpPost]
- public ActionResult StudentByApplyList(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(scoreConvertByApplyServices.GetScoreConvertByApplyViewGrid(configuretView, schoolyearID, collegeID, yearID,
- standardID, classmajorID, coursematerial, recordStatus, pararms.page, pararms.rows));
- }
- public ActionResult ByApplyEdit(Guid? scoreConvertByApplyID)
- {
- ScoreConvertByApplyView scoreConvertByApplyView = new ScoreConvertByApplyView();
- if (scoreConvertByApplyID.HasValue)
- {
- scoreConvertByApplyView = scoreConvertByApplyServices.GetScoreConvertByApplyView(scoreConvertByApplyID);
- }
- else {
- scoreConvertByApplyView.ScoreConvertByApplyID = Guid.NewGuid();
- }
- return View(scoreConvertByApplyView);
- }
- [HttpPost]
- public ActionResult ByApplyEdit(ScoreConvertByApplyView scoreConvertByApplyView)
- {
- try
- {
- var sessionName = FileUploadHelper.GetFileUploadSessionName(scoreConvertByApplyView.ScoreConvertByApplyID);
- var fileList = (List<FileUploadView>)Session[sessionName];
- scoreConvertByApplyServices.Save(scoreConvertByApplyView, fileList);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败," + ex.Message
- });
- }
- }
- public ActionResult StudentByApplyEdit(Guid? scoreConvertByApplyID)
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- ScoreConvertByApplyView scoreConvertByApplyView = new ScoreConvertByApplyView();
- if (scoreConvertByApplyID.HasValue)
- {
- scoreConvertByApplyView = scoreConvertByApplyServices.GetScoreConvertByApplyView(scoreConvertByApplyID);
- }
- else
- {
- scoreConvertByApplyView.ScoreConvertByApplyID = Guid.NewGuid();
- scoreConvertByApplyView.UserID = curUser.UserID;
- }
- return View(scoreConvertByApplyView);
- }
- [HttpPost]
- public ActionResult StudentByApplyEdit(ScoreConvertByApplyView scoreConvertByApplyView)
- {
- try
- {
- var sessionName = FileUploadHelper.GetFileUploadSessionName(scoreConvertByApplyView.ScoreConvertByApplyID);
- var fileList = (List<FileUploadView>)Session[sessionName];
- scoreConvertByApplyServices.Save(scoreConvertByApplyView, fileList);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败," + ex.Message
- });
- }
- }
- [HttpPost]
- public ActionResult ByApplySubmit(string scoreConvertByApplyIDs)
- {
- try
- {
- var scoreConvertByApplyIDList = scoreConvertByApplyIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- scoreConvertByApplyServices.Submit(scoreConvertByApplyIDList, 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 ByApplyApprove(string scoreConvertByApplyIDs, Guid actionID, string comment)
- {
- try
- {
- var scoreConvertByApplyIDList = scoreConvertByApplyIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- scoreConvertByApplyServices.ScoreConvertByApplyApprove(scoreConvertByApplyIDList, 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 });
- }
- }
- [HttpPost]
- public ActionResult ByApplyExcel()
- {
- 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 scoreConvertByApplyIDString = Request.Form["SelectedID"];
- var scoreConvertByApplyIDList = scoreConvertByApplyIDString.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- var dt = scoreConvertByApplyServices.GetScoreConvertByApplyViewList(configuretView, schoolyearID, collegeID, yearID,
- standardID, classmajorID, coursematerial, recordStatus, scoreConvertByApplyIDList)
- .Select(x => new
- {
- x.SchoolyearCode,
- x.CollegeName,
- x.StandardDesc,
- x.ClassmajorName,
- x.LoginID,
- x.Name,
- x.CourseCode,
- x.CourseName,
- x.TotalScore,
- //x.SchoolyearNumName,
- //x.SchoolcodeName,
- 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 StudentByApplyExcel()
- {
- 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 scoreConvertByApplyIDString = Request.Form["SelectedID"];
- var scoreConvertByApplyIDList = scoreConvertByApplyIDString.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- var dt = scoreConvertByApplyServices.GetScoreConvertByApplyViewList(configuretView, schoolyearID, collegeID, yearID,
- standardID, classmajorID, coursematerial, recordStatus, scoreConvertByApplyIDList)
- .Select(x => new
- {
- x.SchoolyearCode,
- x.CollegeName,
- x.StandardDesc,
- x.ClassmajorName,
- x.LoginID,
- x.Name,
- x.CourseCode,
- x.CourseName,
- x.TotalScore,
- x.SchoolyearNumName,
- x.SchoolcodeName,
- 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 ByApplyDelete(string scoreConvertByApplyIDs)
- {
- try
- {
- var scoreConvertByApplyIDList = scoreConvertByApplyIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- scoreConvertByApplyServices.Delete(scoreConvertByApplyIDList);
- return base.Json(new ReturnMessage { IsSuccess = true, Message = "删除成功" });
- }
- catch (Exception ex)
- {
- return base.Json(new ReturnMessage { IsSuccess = false, Message = "删除失败," + ex.Message });
- }
- }
- [HttpGet]
- public ActionResult Attachment(Guid? scoreConvertByApplyID)
- {
- return View();
- }
- [HttpPost]
- public ActionResult Attachment(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var scoreConvertByApplyID = pararms.getExtraGuid("hidScoreConvertByApplyID");
- var attachment = scoreConvertByApplyServices.GetAttachment(scoreConvertByApplyID, pararms.page, pararms.rows);
- return Json(attachment);
- }
- [HttpGet]
- public ActionResult Upload(Guid? scoreConvertByApplyID)
- {
- ScoreConvertByApplyView scoreConvertByApplyView = new ScoreConvertByApplyView();
- scoreConvertByApplyView.ScoreConvertByApplyID = scoreConvertByApplyID.Value;
- return View(scoreConvertByApplyView);
- }
- [HttpPost]
- public ActionResult Upload()
- {
- return Json("上传成功");
- }
- [HttpPost]
- public ActionResult GetFileListByConvertID(Guid? scoreConvertByApplyID)
- {
- //var convertByApplyID = scoreConvertByApplyID.ParseStrTo<Guid>();
- var sessionName = FileUploadHelper.GetFileUploadSessionName(scoreConvertByApplyID ?? Guid.Empty);
- var fileList = (List<FileUploadView>)Session[sessionName];
- return Json(fileList);
- }
- }
- }
|