using EMIS.CommonLogic.Students; using System; using System.Net; using System.Net.Http; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using EMIS.ViewModel; using EMIS.ViewModel.SystemView; using EMIS.CommonLogic.SystemServices; using EMIS.ViewModel.Students; using EMIS.Utility.FormValidate; namespace EMIS.Web.ServiceControllers.StudentManage { public class StudentServicesController: Controller { public IStudentsServices StudentsServices { get; set; } public IUserServices userServices { get; set; } public IStudentRecordServices studentRecordServices { get; set; } public ActionResult GetStudentViewByLoginID(string loginID) { return Json(StudentsServices.GetStudentViewByLoginID(loginID), JsonRequestBehavior.AllowGet); } public ActionResult GetStudentViewByUserID(Guid userID) { return Json(StudentsServices.GetStudentfileView(userID), JsonRequestBehavior.AllowGet); } public ActionResult GetStudentViewByIDNum(string idNum) { return Json(StudentsServices.GetStudentViewByIDNum(idNum), JsonRequestBehavior.AllowGet); } //public ActionResult GetStudentChangeFeilds(Guid? UserID) //{ // return Json(studentRecordServices.GetStudentChangeFeilds(UserID.Value), JsonRequestBehavior.AllowGet); //} //public ActionResult StudentChangeSave(RegistView Model, Guid? UserID) //{ // try // { // userServices.StudentRegist(Model); // return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功" }); // } // catch (Exception ex) // { // return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败,原因:" + ex.Message }); // } //} public ActionResult SaveStudentChange(StudentsView Model, Guid UserID) { try { HttpContext.User = new CustomPrincipal() { UserID = UserID }; StudentsServices.Save(Model); return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功" }); } catch (Exception ex) { return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败,原因:" + ex.Message }); } } } }