123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using System.IO;
- using Bowin.Web.Controls.Mvc;
- using EMIS.Web.Controls;
- using EMIS.Utility;
- using EMIS.ViewModel;
- using EMIS.ViewModel.StudentManage.StudentProfile;
- using EMIS.CommonLogic.StudentManage.StudentProfile;
- using EMIS.CommonLogic.StudentWeb.InfoCenter;
- namespace EMIS.Web.Controllers.StudentWeb.InfoCenter
- {
- [Authorization]
- public class PersonalInfoController : Controller
- {
- public Lazy<IPersonalInfoServices> PersonalInfoServices { get; set; }
- public Lazy<IStudentServices> StudentServices { get; set; }
- /// <summary>
- /// 个人信息(学生)页面
- /// </summary>
- /// <returns></returns>
- public ActionResult Index()
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- var studentView = StudentServices.Value.GetStudentView(user.UserID);
- return View(studentView);
- }
- /// <summary>
- /// 编辑
- /// </summary>
- /// <returns></returns>
- public ActionResult Edit()
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- return View();
- }
- /// <summary>
- /// 编辑
- /// </summary>
- /// <param name="studentView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit(StudentView studentView)
- {
- try
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- return RedirectToAction("MsgShow", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "保存成功。",
- url = Url.Action("Index").AddMenuParameter()
- });
- }
- catch (Exception ex)
- {
- return RedirectToAction("MsgShowAndOpen", "Common", new
- {
- WindowID = Request["WindowID"],
- msg = "保存失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 网上校对开放对象信息
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult CheckOpenObject()
- {
- try
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- PersonalInfoServices.Value.StudentOpenObject(user.UserID);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "允许校对。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "禁止校对:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 个人信息校对
- /// </summary>
- /// <returns></returns>
- public ActionResult CheckEdit()
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- var studentEditFeildList = PersonalInfoServices.Value.GetStudentEditFeildList();
- if (studentEditFeildList != null && studentEditFeildList.Count() > 0)
- {
- ViewBag.EditFeildViews = studentEditFeildList;
- ViewBag.TypeNames = studentEditFeildList.OrderBy(x => x.OrderNo).GroupBy(x => x.TypeName).Select(x => x.Key).ToList();
- var studentView = StudentServices.Value.GetStudentView(user.UserID);
- return View(studentView);
- }
- else
- {
- throw new Exception("对应的校对控制信息为空(未配置)。");
- }
-
- }
- /// <summary>
- /// 个人信息校对
- /// </summary>
- /// <param name="studentView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult CheckEdit(StudentView studentView)
- {
- try
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- Dictionary<string, object> studentViewDataList = new Dictionary<string, object>();
- foreach (var key in typeof(StudentView).GetProperties())
- {
- if (key.PropertyType.IsValueType || key.PropertyType.Name.StartsWith("String"))
- {
- studentViewDataList.Add(key.Name, key.GetValue(studentView, null));
- }
- }
- PersonalInfoServices.Value.StudentCheckEdit(studentViewDataList, user.UserID);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "提交成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "提交失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 核对
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Proofread()
- {
- try
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- PersonalInfoServices.Value.StudentProofread(user.UserID);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "核对成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "核对失败:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 学籍报表(个性化配置)
- /// </summary>
- /// <returns></returns>
- public ActionResult CradReport()
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- ViewBag.LoginUserID = curUser.UserID.ToString();
-
- return View();
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- return null;
- }
- }
- }
|