123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.ExaminationApply;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Common.Data;
- using Bowin.Common.Utility;
- using EMIS.Utility;
- using Bowin.Common;
- using EMIS.CommonLogic.CalendarManage;
- using EMIS.CommonLogic.Students;
- using Bowin.Web.Controls.Mvc;
- using System.Text;
- using EMIS.ViewModel.ExaminationApply;
- using EMIS.ViewModel.Students;
- using System.IO;
- using System.Data;
- namespace EMIS.Web.Controllers.ExaminationApply
- {
- [Authorization]
- public class ExaminationApplayStudentListController : Controller
- {
- public IExaminationSubjectServices ExaminationSubjectServices { get; set; }
- public ISchoolYearServices SchoolYearServices { get; set; }
- public IExamineApplyServices ExamineApplyService { get; set; }
- public ActionResult List()
- {
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);
- ViewBag.SchoolYearID = schoolYear == null ? "-1" : schoolYear.SchoolyearID.ToString();//默认当前学年
- return View();
- }
- public ActionResult Export()
- {
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var examinationBatchID = pararms.getExtraGuid("cgExaminationBatch");
- var examinationTypeID = pararms.getExtraGuid("cgExaminationType");
- var examinationProjectID = pararms.getExtraGuid("cgExaminationProject");
- var schoolAreaID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("cgCollege");
-
- var year = pararms.getExtraInt("ddlYear") == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
- var classmajorID = pararms.getExtraGuid("cgClassmajor");
- var recordStatus = pararms.getExtraInt("PayRecordStatus") == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL ? null : pararms.getExtraInt("PayRecordStatus");
- var isConfirm = pararms.getExtraInt("IsConfirm") == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL ? null : pararms.getExtraInt("IsConfirm");
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- return base.Json(ExaminationSubjectServices.GetStudentListViewGrid(configuretView, schoolyearID, examinationBatchID, examinationTypeID, examinationProjectID,
- schoolAreaID, collegeID, year, classmajorID, recordStatus, isConfirm, (int)pararms.page, (int)pararms.rows));
- }
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var schoolyearID = Request.Form["ddlSchoolyear"].ParseStrTo<Guid>();
- var examinationBatchID = Request.Form["cgExaminationBatch"].ParseStrTo<Guid>();
- var examinationTypeID = Request.Form["cgExaminationType"].ParseStrTo<Guid>();
- var examinationProjectID = Request.Form["cgExaminationProject"].ParseStrTo<Guid>();
- var schoolAreaID = Request.Form["ddlSchoolArea"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlSchoolArea"].ParseStrTo<int>();
- var collegeID = Request.Form["cgCollege"].ParseStrTo<Guid>();
- var year = Request.Form["ddlYear"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlYear"].ParseStrTo<int>();
- var classmajorID = Request.Form["cgClassmajor"].ParseStrTo<Guid>();
- var recordStatus = Request.Form["PayRecordStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["PayRecordStatus"].ParseStrTo<int>();
- var isConfirm = Request.Form["IsConfirm"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["IsConfirm"].ParseStrTo<int>();
- var examinationRegistrationIDs = Request.Form["SelectedID"];
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- List<Guid?> selectIDlist = new List<Guid?>();
- if (examinationRegistrationIDs != "" && examinationRegistrationIDs != null)
- {
- selectIDlist = examinationRegistrationIDs.SplitIDString();
- }
- var dt = ExaminationSubjectServices.GetStudentListViewForExport(configuretView, schoolyearID, examinationBatchID, examinationTypeID, examinationProjectID,
- schoolAreaID, collegeID, year, classmajorID, recordStatus, isConfirm,selectIDlist).Select(x => new
- {
- x.SchoolyearCode,
- x.ExaminationBatchName,
- x.ExaminationProjectName,
- x.SchoolAreaName,
- x.CollegeName,
- x.ClassmajorName,
- x.UserName,
- x.SexName,
- x.CertificatesTypeName,
- x.IDNumber,
- x.FeeTypeAndFee,
- x.PayFee,
- x.RecordStatusStr,
- x.WechatOrderID,
- x.RefundOrderID,
- x.ExaminationRegistrationConfirmNo,
- x.Remark,
- }).ToTable();
- string[] liststring = { "学年学期", "考试批次", "项目名称", "校区", "院系所", "班级", "姓名", "性别", "证件类型", "证件号码", "报名项目(费用)", "金额", "缴费状态", "微信订单号", "微信退款单号", "确认单号", "备注" };
- neh.Export(dt, liststring, "考试报名名单");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功。",
- url = Url.Content("~/ExaminationApplayStudentList/List").AddMenuParameter()
- });
- }
- /// <summary>
- /// 复制新增
- /// </summary>
- /// <param name="examinationRegistrationID"></param>
- /// <returns></returns>
- public ActionResult CopyAdd(Guid examinationRegistrationID)
- {
- StudentListView studentListView = new StudentListView();
- studentListView = ExaminationSubjectServices.GetStudentListView(examinationRegistrationID);
- return View("Edit", studentListView);
- }
- /// <summary>
- /// 复制新增
- /// </summary>
- /// <param name="studentListView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult CopyAdd(StudentListView studentListView)
- {
- studentListView.ExaminationRegistrationID = Guid.Empty;
- return this.Edit(studentListView);
- }
- /// <summary>
- /// 新增
- /// </summary>
- /// <param name="examinationRegistrationID"></param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Edit(Guid? examinationRegistrationID, Guid? schoolYearID, Guid? examinationBatchID, Guid? examinationTypeID, Guid? examinationProjectID)
- {
- StudentListView studentListView = new StudentListView();
- if (schoolYearID.HasValue)
- {
- studentListView.SchoolyearID = schoolYearID;
- }
- if (examinationBatchID.HasValue)
- {
- studentListView.ExaminationBatchID = examinationBatchID;
- }
- if (schoolYearID.HasValue)
- {
- studentListView.ExaminationTypeID = examinationTypeID;
- }
- if (schoolYearID.HasValue)
- {
- studentListView.ExaminationProjectID = examinationProjectID;
- }
- if (examinationRegistrationID.HasValue && examinationRegistrationID != Guid.Empty)
- {
- studentListView = ExaminationSubjectServices.GetStudentListView(examinationRegistrationID);
- }
-
- return View(studentListView);
- }
- /// <summary>
- /// 新增
- /// </summary>
- /// <param name="studentListView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit(StudentListView studentListView)
- {
- try
- {
- var studentList = DataGrid.GetTableData<StudentsView>("dgStudentList");
- ExaminationSubjectServices.AddSave(studentListView, studentList);
- string UrlStr = Url.Action("Edit").AddMenuParameter() + "&schoolYearID=" + studentListView.SchoolyearID + "&examinationBatchID=" + studentListView.ExaminationBatchID
- + "&examinationTypeID=" + studentListView.ExaminationTypeID + "&examinationProjectID=" + studentListView.ExaminationProjectID;
- return RedirectToAction("MsgShowAndOpenAddUrl", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "保存成功!",
- url = UrlStr,
- title = "报名名单新增",
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 修改
- /// </summary>
- /// <param name="examinationRegistrationID"></param>
- /// <returns></returns>
- [HttpGet]
- public ActionResult FeeTypeEdit(Guid? examinationRegistrationID)
- {
- StudentListView studentListView = new StudentListView();
- if (examinationRegistrationID.HasValue && examinationRegistrationID != Guid.Empty)
- {
- studentListView = ExaminationSubjectServices.GetStudentListView(examinationRegistrationID);
- }
- return View(studentListView);
- }
- /// <summary>
- /// 修改
- /// </summary>
- /// <param name="studentListView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult FeeTypeEdit(StudentListView studentListView)
- {
- try
- {
- //var studentList = DataGrid.GetTableData<StudentsView>("dgStudentList");
- ExaminationSubjectServices.EditSave(studentListView);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败,原因:" + ex.Message
- });
- }
- }
- [HttpPost]
- public ActionResult Delete(string examinationRegistrationIDs)
- {
- try
- {
- var examinationRegistrationIDList = examinationRegistrationIDs.Split(',').Select(x => (Guid)new Guid(x)).ToList();
- ExaminationSubjectServices.Delete(examinationRegistrationIDList);
- return base.Json("删除成功");
- }
- catch (Exception ex)
- {
- string mge = ex.Message;
- return base.Json("删除失败,原因:" + mge + "!");
- }
- }
- [HttpGet]
- public ActionResult ChangeFee(string examinationRegistrationIDs)
- {
- ViewBag.ExaminationRegistrationIDs = examinationRegistrationIDs;
- return View();
- }
- [HttpPost]
- public ActionResult ChangeFee(StudentListView studentListView)
- {
- try
- {
- decimal? Fee = Request.Form["Fee"].ParseStrTo<decimal>();
- string Remark = Request.Form["Remark"];
- string examinationRegistrationIDs = Request.Form["examinationRegistrationIDs"];
- var examinationRegistrationIDList = examinationRegistrationIDs.Split(',').Select(x => (Guid)new Guid(x)).ToList();
- ExaminationSubjectServices.ChangeFee(examinationRegistrationIDList, Fee, Remark);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "修改成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "修改失败,原因:" + ex.Message
- });
- }
-
- }
- [HttpPost]
- public ActionResult Confirm(string examinationRegistrationIDs)
- {
- try
- {
- var examinationRegistrationIDList = examinationRegistrationIDs.Split(',').Select(x => (Guid)new Guid(x)).ToList();
- var filePathUrl = Url.Content(Const.LOCAL_SETTING_UPLOAD_FILEPATH);
- var confirmID = ExaminationSubjectServices.Confirm(examinationRegistrationIDList, filePathUrl);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = confirmID.ToString(),
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "确认失败,原因:" + ex.Message
- });
- }
- }
- [HttpPost]
- public ActionResult CancelConfirm(string examinationRegistrationIDs)
- {
- try
- {
- var examinationRegistrationIDList = examinationRegistrationIDs.Split(',').Select(x => (Guid)new Guid(x)).ToList();
- ExaminationSubjectServices.CancelConfirm(examinationRegistrationIDList);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "取消成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "取消失败,原因:" + ex.Message
- });
- }
- }
- [HttpPost]
- public ActionResult StudentList(QueryParamsModel pararms, Guid? examinationRegistrationID)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var studentList = ExaminationSubjectServices.GetStudentViewList(configuretView, examinationRegistrationID,(int)pararms.page, (int)pararms.rows);
- return Json(studentList);
- }
- public ActionResult StudentSelect(Guid? examinationRegistrationID, Guid? examinationBatchID, Guid? examinationProjectID)
- {
- ViewBag.examinationBatchID = examinationBatchID;
- ViewBag.examinationProjectID = examinationProjectID;
- ViewBag.examinationRegistrationID = examinationRegistrationID;
- return View();
- }
- [HttpPost]
- public ActionResult StudentListForSelect(QueryParamsModel pararms, Guid? examinationRegistrationID, Guid? examinationBatchID, Guid? examinationProjectID)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolAreaID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("CollegeComboGrid");
- var grademajorID = pararms.getExtraGuid("GrademajorComboGrid");
- var year = pararms.getExtraInt("ddlYear") == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
- var standardID = pararms.getExtraInt("StandardID") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("StandardID");
- var classmajorID = pararms.getExtraGuid("ClassmajorComboGrid");
- //examinationPlanID = Request.Form["examinationPlanID"].ParseStrTo<Guid>();
- return base.Json(ExaminationSubjectServices.GetStudentListForSelect(configuretView, examinationRegistrationID, examinationBatchID, examinationProjectID, schoolAreaID, collegeID, grademajorID, year, standardID, classmajorID, (int)pararms.page, (int)pararms.rows));
- }
- //[HttpGet]
- //public ActionResult ExportPictures(string selectedIDs)
- //{
- // ViewBag.selectedID = selectedIDs;
- // return View();
- //}
- [HttpPost]
- public ActionResult ExportPictures()
- {
- try
- {
- string WindowStr = Request.UrlReferrer.ToString();
- int IndexofID = WindowStr.LastIndexOf("=");
- WindowStr = WindowStr.Remove(0, IndexofID + 1);
- WindowStr = WindowStr.Substring(0, WindowStr.Length - 1);
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var schoolyearID = Request.Form["ddlSchoolyear"].ParseStrTo<Guid>();
- var examinationBatchID = Request.Form["cgExaminationBatch"].ParseStrTo<Guid>();
- var examinationTypeID = Request.Form["cgExaminationType"].ParseStrTo<Guid>();
- var examinationProjectID = Request.Form["cgExaminationProject"].ParseStrTo<Guid>();
- var schoolAreaID = Request.Form["ddlSchoolArea"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlSchoolArea"].ParseStrTo<int>();
- var collegeID = Request.Form["cgCollege"].ParseStrTo<Guid>();
- var year = Request.Form["ddlYear"].ParseStrTo<int>() == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL ? null : Request.Form["ddlYear"].ParseStrTo<int>();
- var classmajorID = Request.Form["cgClassmajor"].ParseStrTo<Guid>();
- var recordStatus = Request.Form["PayRecordStatus"].ParseStrTo<int>() == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL ? null : Request.Form["PayRecordStatus"].ParseStrTo<int>();
- var isConfirm = Request.Form["IsConfirm"].ParseStrTo<int>() == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL ? null : Request.Form["IsConfirm"].ParseStrTo<int>();
- var selectedIDs = Request.Form["SelectedID"];
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- //WebClient conn = new WebClient();
- List<StudentsView> studentList = new List<StudentsView>();
- if (!string.IsNullOrEmpty(selectedIDs))
- {
- var selectedIDList = selectedIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- studentList = ExaminationSubjectServices.GetStudentViewListByIDList(selectedIDList).ToList();
- }
- else
- {
- studentList = ExaminationSubjectServices.GetStudentListByCondition(configuretView, schoolyearID, examinationBatchID, examinationTypeID, examinationProjectID,
- schoolAreaID, collegeID, year, classmajorID, recordStatus, isConfirm).ToList();
- }
- var remoteFileList = studentList.Where(x => !string.IsNullOrEmpty(x.PhotoUrl)).Select(x =>
- new EMIS.Utility.FileUploadHelper.RemoteFileInfo
- {
- FileName = x.IDNumber + Path.GetExtension(x.PhotoUrl.Trim()),
- RemotePath = (x.PhotoUrl.Trim().StartsWith("http://") ? x.PhotoUrl.Trim() : Url.Content(x.PhotoUrl.Trim()))
- }).ToList();
- //if (ExportPictureType == "IDNumberToPicture")
- //{
- // remoteFileList = studentList.Where(x => !string.IsNullOrEmpty(x.PhotoUrl)).Select(x =>
- // new EMIS.Utility.FileUploadHelper.RemoteFileInfo
- // {
- // FileName = x.IDNumber + Path.GetExtension(x.PhotoUrl.Trim()),
- // RemotePath = (x.PhotoUrl.Trim().StartsWith("http://") ? x.PhotoUrl.Trim() : Url.Content(x.PhotoUrl.Trim()))
- // }).ToList();
- //}
- //if (ExportPictureType == "ExamineeNumToPicture")
- //{
- // remoteFileList = studentList.Where(x => !string.IsNullOrEmpty(x.PhotoUrl)).Select(x =>
- // new EMIS.Utility.FileUploadHelper.RemoteFileInfo
- // {
- // FileName = x.ExamineeNum + Path.GetExtension(x.PhotoUrl.Trim()),
- // RemotePath = (x.PhotoUrl.Trim().StartsWith("http://") ? x.PhotoUrl.Trim() : Url.Content(x.PhotoUrl.Trim()))
- // }).ToList();
- //}
- //if (ExportPictureType == "LoginIDandUserNameToPicture")
- //{
- // remoteFileList = studentList.Where(x => !string.IsNullOrEmpty(x.PhotoUrl)).Select(x =>
- // new EMIS.Utility.FileUploadHelper.RemoteFileInfo
- // {
- // FileName = x.LoginID + x.UserName + Path.GetExtension(x.PhotoUrl.Trim()),
- // RemotePath = (x.PhotoUrl.Trim().StartsWith("http://") ? x.PhotoUrl.Trim() : Url.Content(x.PhotoUrl.Trim()))
- // }).ToList();
- //}
- if (remoteFileList.Count > 0)
- {
- var zipFileStream = FileUploadHelper.DownLoadFiles(Guid.NewGuid().ToString(), "学生相片", remoteFileList);
- return File(zipFileStream, System.Net.Mime.MediaTypeNames.Application.Zip, "学生相片.zip");
- }
- else
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "没有相片可导出!",
- url = Url.Action("List").AddMenuParameter(),
- });
- }
- }
- catch (Exception ex)
- {
- string mge = ex.Message;
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "导出失败。原因:" + mge + "!",
- url = Url.Action("List").AddMenuParameter()
- });
- }
- }
- public ActionResult RegistrationConfirmReport(string examinationRegistrationConfirmIDs)
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- ViewBag.ExaminationRegistrationConfirmID = examinationRegistrationConfirmIDs;
- //ViewBag.UserID = curUser.UserID.ToString();
- return View();
- }
- [HttpGet]
- public ActionResult StudentImport(string errorFile, string operationTips)
- {
- ViewBag.ErrorFile = errorFile;
- //if (string.IsNullOrEmpty(operationTips))
- //{
- // operationTips = "错误数据下载";
- //}
- ViewBag.operationTips = operationTips;
- //ViewBag.result = errorResult;
- //if (errorResult != null)
- //{
- // return View(errorResult);
- //}
- return View(new ExcelImportResult());
- }
- [HttpPost]
- public ActionResult StudentImport(HttpPostedFileBase file, Guid? schoolyearID, Guid? examinationBatchID, Guid? examinationTypeID, Guid? examinationProjectID, Guid? examinationProjectFeeID, int? feeTypeID)
- {
- try
- {
- //var schoolyearID = pararms.getExtraGuid("schoolyearID");
- //var examinationBatchID = pararms.getExtraGuid("examinationBatchID");
- //var examinationTypeID = pararms.getExtraGuid("examinationTypeID");
- //var examinationProjectID = pararms.getExtraGuid("examinationProjectID");
- //var examinationProjectFeeID = pararms.getExtraGuid("examinationProjectFeeID");
- //var feeTypeID = pararms.getExtraInt("feeTypeID") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("feeTypeID");
- if (!NpoiExcelHelper.GetIsCompatible(file.FileName))
- {
- throw new Exception("只允许上传xls和xlsx格式的Excel文件!");
- }
- var excel = new NpoiExcelHelper();
- #region 表单头
- Dictionary<string, string> cellheader = new Dictionary<string, string>
- {
- { "IDNumber", "证件号" },
- { "UserName", "姓名" },
- };
- #endregion
- StringBuilder errorMsg = new StringBuilder(); // 错误信息
- string sourceWebPath = FileUploadHelper.UploadFile(file);
- var sourcePhysicalPath = Server.MapPath(sourceWebPath);
- List<StudentListView> errList = new List<StudentListView>();
- List<StudentListView> dataList = new List<StudentListView>();
- int errCount = 0;
- int OkCount = 0;
- var insertList = ExaminationSubjectServices.StudentImport(cellheader, out OkCount, out errList, out errCount, sourcePhysicalPath,
- schoolyearID, examinationBatchID, examinationTypeID, examinationProjectID, examinationProjectFeeID, feeTypeID);
- if (errCount > 0)
- {
- //errorResult = insertList;
- var errorPhysicalPath = sourcePhysicalPath;
- var errorWebPaths = sourceWebPath;
- string errorWebPath = string.Format("{0}", NpoiExcelHelper.EntityListToExcel2003(cellheader, errList, "学生报名名单失败文件", errorWebPaths));
- insertList.ErrorFilePath = errorWebPath;
- insertList.Message = string.Format("提示:成功导入{0}条记录,失败{1}条,详情请点击错误数据下载查看。", OkCount < 1 ? 0 : OkCount, errCount < 1 ? 0 : errCount);
- //ViewBag.operationTips = Errinfo;
- //ViewBag.result = insertList;
- //// //return RedirectToAction("Import", new { errorFile = errorWebPath, operationTips = Errinfo });
- //return RedirectToAction("MsgShow", "Common", new
- //{
- // WindowID = "none",
- // msg = "导入失败!",
- // url = Url.Action("StudentImport").AddMenuParameter() + "&errorFile=" + errorWebPath + "&operationTips=" + Errinfo + "&result=" + insertList.Data + "&WindowID=" + Request["WindowID"]
- //});
- return View(insertList);
- }
- else
- {
- return View(insertList);
- }
- }
- catch (Exception ex)
- {
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "导入失败,原因:" + ex.Message + "!",
- url = Url.Action("Edit").AddMenuParameter()
- });
- }
- }
- /// <summary>
- /// 获取批次下拉(根据学年学期)
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetExaminationBatchViewGrid(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("SchoolYearDropdown");
- return base.Json(ExaminationSubjectServices.GetExaminationBatchViewForComboGrid(configuretView, schoolyearID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 获取考试类型下拉(根据学年学期)
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetExaminationTypeViewGrid(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("SchoolYearDropdown");
- var examinationBatchID = pararms.getExtraGuid("cgExaminationBatch");
- return base.Json(ExamineApplyService.GetExaminationTypeViewForComboGrid(configuretView, schoolyearID, examinationBatchID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 获取项目下拉(根据批次,考试类型)
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetProjectListViewGrid(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var examinationBatchID = pararms.getExtraGuid("cgExaminationBatch");
- var examinationTypeID = pararms.getExtraGuid("cgExaminationType");
- return base.Json(ExaminationSubjectServices.GetExaminationProjectViewGridForComboGrid(configuretView, examinationBatchID, examinationTypeID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 获取项目收费标准下拉(根据项目)学生端,根据批次项目控制查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetExaminationProjectFeeViewGrid(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var examinationProjectID = pararms.getExtraGuid("cgExaminationProject");
- var examinationBatchID = pararms.getExtraGuid("cgExaminationBatch");
- return base.Json(ExaminationSubjectServices.GetProjectFeeTypeViewForComboGrid(configuretView, examinationBatchID, examinationProjectID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 获取项目收费标准下拉(根据项目)教师端,根据收费项目查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetExaminationProjectFeeViewByBaseGrid(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var examinationProjectID = pararms.getExtraGuid("cgExaminationProject");
- var examinationBatchID = pararms.getExtraGuid("cgExaminationBatch");
- return base.Json(ExaminationSubjectServices.GetProjectFeeTypeViewByBaseForComboGrid(configuretView, examinationBatchID, examinationProjectID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 获取收费项下拉(根据项目收费标准)
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetFeeTypeViewGrid(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var examinationProjectFeeID = pararms.getExtraGuid("cgExaminationProjectFee");
- return base.Json(ExaminationSubjectServices.GetFeeTypeViewForComboGrid(configuretView, examinationProjectFeeID, (int)pararms.page, (int)pararms.rows));
- }
- public ActionResult InfoExport()
- {
- return View();
- }
- public ActionResult DailyExport(QueryParamsModel pararms, string selectedIDs)
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var examinationBatchID = pararms.getExtraGuid("cgExaminationBatch");
- var examinationTypeID = pararms.getExtraGuid("cgExaminationType");
- var examinationProjectID = pararms.getExtraGuid("cgExaminationProject");
- var schoolAreaID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("cgCollege");
- var year = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
- var classmajorID = pararms.getExtraGuid("cgClassmajor");
- var recordStatus = pararms.getExtraInt("PayRecordStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("PayRecordStatus");
- var isConfirm = pararms.getExtraInt("IsConfirm") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("IsConfirm");
- var examinationRegistrationIDs = Request.Form["SelectedID"];
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- List<Guid?> selectIDlist = new List<Guid?>();
- if (selectedIDs != "" && selectedIDs != null)
- {
- selectIDlist = selectedIDs.SplitIDString();
- }
- var dt = ExaminationSubjectServices.GetStudentListForExportViewGrid(configuretView, schoolyearID, examinationBatchID, examinationTypeID, examinationProjectID,
- schoolAreaID, collegeID, year, classmajorID, recordStatus, isConfirm, selectIDlist).Select(x => new
- {
- x.Year,
- x.SchoolAreaName,
- x.CollegeName,
- x.StandardName,
- x.ClassmajorName,
- x.ExaminationTypeName,
- x.ExaminationProjectName,
- x.StudentNo,
- x.UserName,
- x.SexName,
- x.IDNumber,
- BirthDate = (x.BirthDate.HasValue ? x.BirthDate.Value.ToString("yyyy-MM-dd") : ""),
- x.NationName,
- x.EducationName,
- x.ResidenceTypeName,
- x.ResidenceStr,
- x.HomeAddress,
- x.Mobile,
- x.FeeTypeAndFee,
- x.PayFee,
- RegistrDate = (x.RegistrDate.HasValue ? x.RegistrDate.Value.ToString("yyyy-MM-dd") : ""),
- PayDate = (x.PayDate.HasValue ? x.PayDate.Value.ToString("yyyy-MM-dd") : ""),
- x.WeChatNo,
- x.RecordStatusStr,
- x.Remark
- }).ToTable();
- dt = AddSeriNumToDataTable(dt);
- string[] liststring = { "序号","年级", "校区", "院系所", "专业", "班级", "项目种类","项目名称","学号", "姓名", "性别",
- "身份证号", "出生日期","民族","学历","户口性质", "户口所在地", "家庭住址", "联系电话", "报名项目(费用)",
- "总费用","报名日期","收费日期","微信号", "状态", "备注" };
- neh.Export(dt, liststring, "常规信息");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功。",
- url = Url.Content("~/ExaminationApplayStudentList/InfoExport").AddMenuParameter()
- });
- }
- public ActionResult PJ5Export(QueryParamsModel pararms, string selectedIDs)
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var examinationBatchID = pararms.getExtraGuid("cgExaminationBatch");
- var examinationTypeID = pararms.getExtraGuid("cgExaminationType");
- var examinationProjectID = pararms.getExtraGuid("cgExaminationProject");
- var schoolAreaID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("cgCollege");
- var year = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
- var classmajorID = pararms.getExtraGuid("cgClassmajor");
- var recordStatus = pararms.getExtraInt("PayRecordStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("PayRecordStatus");
- var isConfirm = pararms.getExtraInt("IsConfirm") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("IsConfirm");
- var examinationRegistrationIDs = Request.Form["SelectedID"];
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- List<Guid?> selectIDlist = new List<Guid?>();
- if (examinationRegistrationIDs != "" && examinationRegistrationIDs != null)
- {
- selectIDlist = examinationRegistrationIDs.SplitIDString();
- }
- var dt = ExaminationSubjectServices.GetStudentListForExportViewGrid(configuretView, schoolyearID, examinationBatchID, examinationTypeID, examinationProjectID,
- schoolAreaID, collegeID, year, classmajorID, recordStatus, isConfirm, selectIDlist).Select(x => new
- {
- x.UserName,
- x.CertificatesTypeName,
- x.IDNumber,
- x.SpecialSign,
- BirthDate = (x.BirthDate.HasValue ? x.BirthDate.Value.ToString("yyyy-MM-dd") : ""),
- x.SexName,
- x.EducationName,
- x.WorkingYears,
- x.WorkPlace,
- x.ProfessionalQualificationLevel,
- x.Copy,
- x.ExaminationTypeName,
- x.AppraisalPersonalType,
- x.PersonalType,
- x.ResidenceTypeName,
- x.ResidenceStr,
- x.NationName,
- x.PoliticsName,
- x.MaritalStatus,
- x.NationalQualificationLevel,
- x.PositionLevel,
- x.NationalAndCode,
- x.Address,
- RegistrDate = (x.RegistrDate.HasValue ? x.RegistrDate.Value.ToString("yyyy-MM-dd") : ""),
- x.ResitTheory,
- x.ResitPractice,
- x.ResitOne,
- x.ResitTwo,
- x.ResitThree,
- x.ResitFour,
- x.ProfessionalTitle,
- x.IsNotTheory,
- x.TheoryScore,
- x.PracticeScore,
- x.ResitOneScore,
- x.ResitTwoScore,
- x.ResitThreeScore,
- x.ResitFourScore,
- x.Mobile
- }).ToTable();
- dt = AddSeriNumToDataTable(dt);
- string[] liststring = { "序号","姓名", "证件名称", "证件编号", "特殊标志", "出生日期","性别","文化程度", "工龄", "工作单位","上一级职业资格级别", "副本",
- "考试类型","鉴定人员类别","人员类别", "户口性质", "户口所在地", "民族", "政治面貌","婚姻状况","国家职业资格等级","专业技术职务级别","国家/地区代码",
- "联系地址", "报名日期", "补考理论","补考实操","补加考1","补加考2", "补加考3", "补加考4","职称","是否免考理论","理论成绩","实操成绩", "加考1成绩",
- "加考2成绩", "加考3成绩","加考4成绩","考生手机"};
- neh.Export(dt, liststring, "广州市PJ5信息");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功。",
- url = Url.Content("~/ExaminationApplayStudentList/InfoExport").AddMenuParameter()
- });
- }
- public ActionResult HighNewExport(QueryParamsModel pararms, string selectedIDs)
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var examinationBatchID = pararms.getExtraGuid("cgExaminationBatch");
- var examinationTypeID = pararms.getExtraGuid("cgExaminationType");
- var examinationProjectID = pararms.getExtraGuid("cgExaminationProject");
- var schoolAreaID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("cgCollege");
- var year = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
- var classmajorID = pararms.getExtraGuid("cgClassmajor");
- var recordStatus = pararms.getExtraInt("PayRecordStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("PayRecordStatus");
- var isConfirm = pararms.getExtraInt("IsConfirm") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("IsConfirm");
- var examinationRegistrationIDs = Request.Form["SelectedID"];
- if (configuretView.Attribute == Bowin.Web.Controls.Mvc.DropdownList.SELECT_ALL.ToString()) configuretView.Attribute = "";
- List<Guid?> selectIDlist = new List<Guid?>();
- if (examinationRegistrationIDs != "" && examinationRegistrationIDs != null)
- {
- selectIDlist = examinationRegistrationIDs.SplitIDString();
- }
- var dt = ExaminationSubjectServices.GetStudentListForExportViewGrid(configuretView, schoolyearID, examinationBatchID, examinationTypeID, examinationProjectID,
- schoolAreaID, collegeID, year, classmajorID, recordStatus, isConfirm, selectIDlist).Select(x => new
- {
- x.CertificatesTypeName,
- x.IDNumber,
- x.UserName,
- x.EnglishName,
- BirthDate = (x.BirthDate.HasValue ? x.BirthDate.Value.ToString("yyyy-MM-dd") : ""),
- x.SexName,
- x.WorkPlace,
- x.EducationName,
- x.JoinWorkDate,
- x.WorkingYears,
- x.WorkType,
- x.Area,
- x.ResidenceStr,
- x.Place,
- x.NationName,
- x.PoliticsName,
- x.Mobile,
- x.ZipCode,
- x.IDCardAddress,
- x.HomeAddress,
- x.IsSoldier,
- x.IsLaidOff,
- x.IsUnemployment,
- x.IsDisability,
- x.IsFarmer,
- x.IsLabour,
- x.Other,
- x.DeclareOccupation,
- x.DeclareLevel,
- x.DeclareCondition,
- x.AppraisalType,
- x.OldCertificateNumber,
- x.ExamineeType,
- x.SubsidyTarget,
- x.SubsidyCertificateType,
- x.SubsidyCertificateNumber,
- x.ExamineeRemark,
- x.ExamineeCampus
- }).ToTable();
- dt = AddSeriNumToDataTable(dt);
- string[] liststring = { "序号","身份证件类型","身份证件编号", "中文姓名", "英文姓名", "出生日期","性别", "工作单位","文化程度", "参加工作时间","职业年限",
- "从事职业","考生来源","户口所在省(市)","户口所在市(区)", "民族", "政治面貌","联系电话","邮政编码","身份证住址","常住住址", "现役军人", "下岗人员",
- "失业人员", "残疾人员","农民工","劳教劳改人员", "其它", "申报职业","申报级别","申报条件","鉴定分类","原证书编号", "考生类别","补贴对象", "补贴证件类型",
- "补贴证件编码","报名备注","报名单位"};
- neh.Export(dt, liststring, "高新信息");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功。",
- url = Url.Content("~/ExaminationApplayStudentList/InfoExport").AddMenuParameter()
- });
- }
- [HttpPost]
- public ActionResult ExportBySelect(QueryParamsModel pararms, string selectedIDs, string colnames, string showname)
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var examinationBatchID = pararms.getExtraGuid("cgExaminationBatch");
- var examinationTypeID = pararms.getExtraGuid("cgExaminationType");
- var examinationProjectID = pararms.getExtraGuid("cgExaminationProject");
- var schoolAreaID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("cgCollege");
- var year = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
- var classmajorID = pararms.getExtraGuid("cgClassmajor");
- var recordStatus = pararms.getExtraInt("PayRecordStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("PayRecordStatus");
- var isConfirm = pararms.getExtraInt("IsConfirm") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("IsConfirm");
- List<Guid?> selectIDlist = new List<Guid?>();
- if (selectedIDs != "" && selectedIDs != null)
- {
- selectIDlist = selectedIDs.SplitIDString();
- }
- List<string> namelist = new List<string>();
- for (int i = 0; i < showname.Split(',').Length; i++)
- {
- string col = showname.Split(',')[i];
- if (!string.IsNullOrEmpty(col))
- {
- namelist.Add(col);
- }
- }
- List<string> idlist = new List<string>();
- for (int i = 0; i < colnames.Split(',').Length; i++)
- {
- string col = colnames.Split(',')[i];
- if (!string.IsNullOrEmpty(col))
- {
- idlist.Add(col);
- }
- }
- var dt = ExaminationSubjectServices.GetStudentListForExportViewGrid(configuretView, schoolyearID, examinationBatchID, examinationTypeID, examinationProjectID,
- schoolAreaID, collegeID, year, classmajorID, recordStatus, isConfirm, selectIDlist).Select(x => new
- {
- x.SchoolAreaName,
- x.ExamineeNum,
- x.UserName,
- x.SexName,
- BirthDate = (x.BirthDate.HasValue ? x.BirthDate.Value.ToString("yyyy-MM-dd") : ""),
- x.IDNumber,
- x.QQ,
- x.Email,
- x.PhoneNumber,
- x.SchoolCode,
- x.SchoolName,
- x.StandardCode,
- x.StandardName,
- LearnSystem = (x.LearnSystem.HasValue ? (x.LearnSystem.Value % 1 == 0 ? x.LearnSystem.Value.ToString("0") : x.LearnSystem.Value.ToString("0.0")) : ""),
- x.LearningformName,
- x.EducationName,
- EntranceDate = (x.EntranceDate.HasValue ? x.EntranceDate.Value.ToString("yyyy-MM-dd") : ""),
- PlanningGraduateDate = (x.PlanningGraduateDate.HasValue ? x.PlanningGraduateDate.Value.ToString("yyyy-MM-dd") : ""),
- x.GraduationResultName,
- x.StudentNo,
- x.PoliticsName,
- x.NationName,
- x.CampusName,
- x.CollegeName,
- x.ClassmajorCode,
- x.ClassmajorName,
- x.Remark,
- }).ToTable(namelist);
- string[] liststring = idlist.ToArray();
- neh.Export(dt, liststring, "自定义信息");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Content("~/ExaminationApplayStudentList/InfoExport").AddMenuParameter()
- });
- }
- /// <summary>
- /// 在DataTable中添加一序号列,编号从1依次递增
- /// </summary>
- /// <param >DataTable</param>
- /// <returns></returns>
- private DataTable AddSeriNumToDataTable(DataTable dt)
- {
- //需要返回的值
- DataTable dtNew;
- if (dt.Columns.IndexOf("序号") >= 0)
- {
- dtNew = dt;
- }
- else //添加一序号列,并且在第一列
- {
- int rowLength = dt.Rows.Count;
- int colLength = dt.Columns.Count;
- DataRow[] newRows = new DataRow[rowLength];
- dtNew = new DataTable();
- //在第一列添加“序号”列
- dtNew.Columns.Add("序号");
- for (int i = 0; i < colLength; i++)
- {
- dtNew.Columns.Add(dt.Columns[i].ColumnName);
- //复制dt中的数据
- for (int j = 0; j < rowLength; j++)
- {
- if (newRows[j] == null)
- newRows[j] = dtNew.NewRow();
- //将其他数据填充到第二列之后,因为第一列为新增的序号列
- newRows[j][i + 1] = dt.Rows[j][i];
- }
- }
- foreach (DataRow row in newRows)
- {
- dtNew.Rows.Add(row);
- }
- }
- //对序号列填充,从1递增
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- dtNew.Rows[i]["序号"] = i + 1;
- }
- return dtNew;
- }
- public ActionResult AddStudentsCheck(string IDNumberStr, Guid? schoolyearID, Guid? examinationBatchID, Guid? examinationTypeID, Guid? examinationProjectID, Guid? examinationProjectFeeID, int? feeTypeID)
- {
- List<string> IDNumberlist = new List<string>();
- if (IDNumberStr != "" && IDNumberStr != null)
- {
- IDNumberlist = IDNumberStr.Split(',').ToList();
- }
- var studentList = ExaminationSubjectServices.AddStudentsCheck(IDNumberlist, schoolyearID, examinationBatchID, examinationTypeID, examinationProjectID, examinationProjectFeeID, feeTypeID);
- //var successfulID = studentList.Select(x => x.IDNumber).ToList();
- return Json(studentList);
- }
- }
- }
|