123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.Students;
- using System.Dynamic;
- using EMIS.ViewModel.ScoreManage;
- using Bowin.Common.Utility;
- using EMIS.ViewModel;
- using EMIS.Utility;
- using EMIS.Entities;
- using EMIS.CommonLogic.ScoreManage;
- using EMIS.Web.Controls;
- using EMIS.ViewModel.CacheManage;
- using EMIS.CommonLogic.CalendarManage;
- using EMIS.CommonLogic.SystemServices;
- namespace EMIS.Web.Controllers.ScoreManage
- {
- [Authorization]
- public class PersonalScoreController : Controller
- {
- public IStudentScoreServices StudentScoreServices { get; set; }
- public ICourseGradeServices CourseGradeServices { get; set; }
- public IStudentsServices StudentfileServices { get; set; }
- public ISchoolYearServices SchoolYearServices { get; set; }
- public IParameterServices ParameterServices { get; set; }
-
- /// <summary>
- /// 通用个人成绩页面
- /// </summary>
- /// <returns></returns>
- public ActionResult List()
- {
- List<PersonalCoursematerialScoreView> listPersonalCoursematerialScoreView = new List<PersonalCoursematerialScoreView>();
- ViewBag.ListPersonalCoursematerialScoreView = listPersonalCoursematerialScoreView;
- //默认加载学生成绩
- //var student = StudentfileServices.Value.GetStudentView();
- //ViewBag.StudentNo = student.UserID;
- return View();
- }
- /// <summary>
- /// 广体个人成绩页面
- /// </summary>
- /// <returns></returns>
- public ActionResult NewList()
- {
- List<PersonalCoursematerialScoreView> listPersonalCoursematerialScoreView = new List<PersonalCoursematerialScoreView>();
- ViewBag.ListPersonalCoursematerialScoreView = listPersonalCoursematerialScoreView;
- var userID = Request.Params["UserID"];
- if (userID != null)
- {
- ViewBag.StudentNo = userID;
- }
- //默认加载学生成绩
- //var student = StudentfileServices.Value.GetStudentView();
- //ViewBag.StudentNo = student.UserID;
- return View();
- }
- //[HttpPost]
- //public ActionResult List(Guid? Id)
- //{
- // var userID = Request.Form["StudentsComboGrid"].ParseStrTo<Guid>();
- // List<PersonalCoursematerialScoreView> listPersonalCoursematerialScoreView = new List<PersonalCoursematerialScoreView>();
- // //课程成绩
- // var listCoursematerialScore = courseGradeServices.Value.GetStudentCourseGrade((Guid)userID);
- // if (listCoursematerialScore.Count > 0)
- // {
- // var Student = courseGradeServices.Value.GetStudentPersonalScore((Guid)userID);
- // PersonalCoursematerialScoreView personalCoursematerialScoreView = new PersonalCoursematerialScoreView();
- // if (Student != null)
- // {
- // personalCoursematerialScoreView.UserID = Student.UserID;
- // personalCoursematerialScoreView.LoginID = Student.LoginID;
- // personalCoursematerialScoreView.UserName = Student.UserName;
- // personalCoursematerialScoreView.CollegeName = Student.FacultyName;
- // personalCoursematerialScoreView.ClassName = Student.ClassName;
- // personalCoursematerialScoreView.CoursematerialCount = Student.Menshu;
- // personalCoursematerialScoreView.AVGScore = Student.AverageGrade;
- // personalCoursematerialScoreView.TotalCredit = Student.TotalScore;
- // personalCoursematerialScoreView.PlanningGraduateDate = Student.PlanningGraduateDate;
- // }
- // personalCoursematerialScoreView.ListStarttermID = listCoursematerialScore.Select(x => (int)x.StarttermID).Distinct().ToList();
- // personalCoursematerialScoreView.ListCourseGradeView = listCoursematerialScore.ToList();
- // listPersonalCoursematerialScoreView.Add(personalCoursematerialScoreView);
- // }
- // ViewBag.ListPersonalCoursematerialScoreView = listPersonalCoursematerialScoreView;
- // return View();
- //}
- [HttpPost]
- public ActionResult CoursematerialList(Guid? userID)
- {
- userID = userID ?? Guid.Empty;
- List<PersonalCoursematerialScoreView> listPersonalCoursematerialScoreView = new List<PersonalCoursematerialScoreView>();
- //课程成绩
- var listCoursematerialScore = CourseGradeServices.GetStudentCourseGrade((Guid)userID);
- if (listCoursematerialScore.Count > 0)
- {
- var Student = CourseGradeServices.GetStudentPersonalScore((Guid)userID);
- PersonalCoursematerialScoreView personalCoursematerialScoreView = new PersonalCoursematerialScoreView();
- if (Student != null)
- {
- personalCoursematerialScoreView.UserID = Student.UserID;
- personalCoursematerialScoreView.LoginID = Student.LoginID;
- personalCoursematerialScoreView.UserName = Student.UserName;
- personalCoursematerialScoreView.CollegeName = Student.FacultyName;
- personalCoursematerialScoreView.ClassName = Student.ClassName;
- personalCoursematerialScoreView.CoursematerialCount = Student.Menshu;
- personalCoursematerialScoreView.AVGScore = Student.AverageGrade ?? 0;
- personalCoursematerialScoreView.TotalCredit = Student.TotalScore ?? 0;
- personalCoursematerialScoreView.PlanningGraduateDate = Student.PlanningGraduateDate;
- }
- try
- {
- personalCoursematerialScoreView.ListStarttermID = listCoursematerialScore.Select(x => (int)x.StarttermID).Distinct().ToList();
- }
- catch (Exception ex)
- {
- throw ex;
- }
- personalCoursematerialScoreView.ListCourseGradeView = listCoursematerialScore.ToList();
- listPersonalCoursematerialScoreView.Add(personalCoursematerialScoreView);
- }
- return Json(listPersonalCoursematerialScoreView);
- }
- /// <summary>
- /// 个人成绩(开课学期分组)
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult NewCoursematerialList(Guid? userID)
- {
- userID = userID ?? Guid.Empty;
- List<PersonalCoursematerialScoreView> listPersonalCoursematerialScoreView = new List<PersonalCoursematerialScoreView>();
- //课程成绩
- var listCoursematerialScore = CourseGradeServices.GetStudentCourseGrade((Guid)userID);
- if (listCoursematerialScore.Count > 0)
- {
- var Student = CourseGradeServices.GetStudentPersonalScoreGT((Guid)userID);
- PersonalCoursematerialScoreView personalCoursematerialScoreView = new PersonalCoursematerialScoreView();
- if (Student != null)
- {
- personalCoursematerialScoreView.UserID = Student.UserID;
- personalCoursematerialScoreView.LoginID = Student.LoginID;
- personalCoursematerialScoreView.UserName = Student.UserName;
- personalCoursematerialScoreView.CollegeName = Student.FacultyName;
- personalCoursematerialScoreView.ClassName = Student.ClassName;
- personalCoursematerialScoreView.CoursematerialCount = Student.Menshu;
- personalCoursematerialScoreView.AVGScore = Student.AverageGrade ?? 0;
- //personalCoursematerialScoreView.TotalCredit = (Student.Required ?? 0) + (Student.CapLimit ?? 0) + (Student.Optional ?? 0) + (Student.Direction ?? 0) + (Student.Commonality ?? 0) + (Student.PractiseNotCredit ?? 0);//Student.TotalScore ?? 0;
- personalCoursematerialScoreView.PlanningGraduateDate = Student.PlanningGraduateDate;
- personalCoursematerialScoreView.RequiredCredit = ((Student.Required ?? 0) - (Student.PractiseCredit ?? 0));//必修 - 实践环节
- personalCoursematerialScoreView.OptionalCourseCredit = ((Student.OptionalCourseCredit ?? 0) - (Student.SchoolbasedCredit ?? 0) - (Student.ElectiveCredit ?? 0));//限选 - 校本课程 - 方向性选修
- personalCoursematerialScoreView.FreeSelectionCourseCredit = (Student.FreeSelectionCourseCredit ?? 0) - (Student.ElectivePublicCredit ?? 0);//任选 - 公共选修
- personalCoursematerialScoreView.ElectiveCredit = Student.ElectiveCredit ?? 0;
- personalCoursematerialScoreView.ElectivePublicCredit = Student.ElectivePublicCredit ?? 0;
- personalCoursematerialScoreView.PractiseNotCredit = Student.PractiseNotCredit ?? 0;//实践环节不包含俱乐部
- personalCoursematerialScoreView.ClubWithSchoolbasedCredit = ((Student.PractiseWithClub ?? 0) > 4 ? 4 : (Student.PractiseWithClub ?? 0)) + ((Student.SchoolbasedWithClub ?? 0) > 4 ? 4 : (Student.SchoolbasedWithClub ?? 0)) + (Student.SchoolbasedNotClub ?? 0);
- personalCoursematerialScoreView.TotalCredit = (Student.Required ?? 0) + (Student.OptionalCourseCredit ?? 0) + (Student.FreeSelectionCourseCredit ?? 0) - (Student.PractiseCredit ?? 0) - (Student.SchoolbasedCredit ?? 0)
- + (Student.PractiseNotCredit ?? 0) + ((Student.PractiseWithClub ?? 0) > 4 ? 4 : (Student.PractiseWithClub ?? 0)) + (Student.SchoolbasedNotClub ?? 0) + ((Student.SchoolbasedWithClub ?? 0) > 4 ? 4 : (Student.SchoolbasedWithClub ?? 0));
- }
- try
- {
- personalCoursematerialScoreView.ListStarttermID = listCoursematerialScore.Select(x => (int)x.StarttermID).Distinct().ToList();
- }
- catch (Exception ex)
- {
- throw ex;
- }
- personalCoursematerialScoreView.ListCourseGradeView = listCoursematerialScore.ToList();
- listPersonalCoursematerialScoreView.Add(personalCoursematerialScoreView);
- }
- return Json(listPersonalCoursematerialScoreView);
- }
- /// <summary>
- /// 学生个人成绩报表
- /// </summary>
- /// <returns></returns>
- public ActionResult StudentScoreReport()
- {
- return View();
- }
- /// <summary>
- /// 列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetSubmitedScoreList(Guid? CoursematerialID, int? StartTermID, Guid? UserID)
- {
- return base.Json(CourseGradeServices.GetSubmitedScoreList(CoursematerialID.Value, StartTermID, UserID.Value));
- }
- public ActionResult Add(Guid? submitedScoreID)
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current; //获取当前登录用户
- Guid curUserID = curUser.UserID;
- ViewBag.curUserName = curUser.Name;
- ViewBag.curLoginID = curUser.LoginID;
- List<Dictionary<string, string>> listDictionary = new List<Dictionary<string, string>>();
- var scoreDynamicTypes = DictionaryHelper.GetDictionaryValue(DictionaryItem.CF_ScoreType);
- SubmitedScoreDetailView submitedScoreDetailView = new SubmitedScoreDetailView();
- if (submitedScoreID.HasValue)
- {
- submitedScoreDetailView = CourseGradeServices.GetSubmitedScoreDetailView(submitedScoreID);
- ER_SubmitedScore submitedScore = CourseGradeServices.GetSubmitedScore(submitedScoreID);
- var listSubmitedScoreDetail = submitedScore.ER_SubmitedScoreDetail.ToList();
- foreach (var scoreDynamicType in scoreDynamicTypes)
- {
- ER_SubmitedScoreDetail submitedScoreDetail = listSubmitedScoreDetail.Where(x => x.ScoreTypeID == scoreDynamicType.Value).FirstOrDefault();
- listDictionary.Add(new Dictionary<string, string> { { "Formula_" + submitedScoreDetail.ScoreTypeID, submitedScoreDetail.Score.ToString() } });
- }
- listDictionary.Add(new Dictionary<string, string> { { "TotalScore", submitedScoreDetailView.TotalScore.ToString() } });
- }
- else
- {
- submitedScoreDetailView.StarttermID = Convert.ToInt32(Request["StarttermID"]);
- submitedScoreDetailView.SchoolyearID = new Guid(Request["SchoolyearID"]);
- submitedScoreDetailView.CoursematerialID = new Guid(Request["CoursematerialID"]);
- submitedScoreDetailView.UserID = new Guid(Request["UserID"]);
- foreach (var scoreDynamicType in scoreDynamicTypes)
- {
- listDictionary.Add(new Dictionary<string, string> { { "Formula_" + scoreDynamicType.Value, "0" } });
- }
- listDictionary.Add(new Dictionary<string, string> { { "TotalScore", "0" } });
- }
- submitedScoreDetailView.CreatorUserID = curUserID;
- ViewBag.ListDictionary = listDictionary;
- ViewBag.ScoreDynamicTypes = scoreDynamicTypes;
- return View(submitedScoreDetailView);
- }
- /// <summary>
- /// 新增
- /// </summary>
- /// <param name="submitedScoreDetailView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Add(SubmitedScoreDetailView submitedScoreDetailView)
- {
- try
- {
- int atype = Convert.ToInt32(Request.Form["hid_atype"]);
- List<ExpandoObject> listExpandoObject = new List<ExpandoObject>();
- var differentDynamicTypes = DictionaryHelper.GetDictionaryValue(DictionaryItem.CF_ScoreType);
- foreach (var differentDynamicType in differentDynamicTypes)
- {
- dynamic dyic = new ExpandoObject();
- dyic.ScoreTypeID = differentDynamicType.Value;
- dyic.Score = Convert.ToDecimal(Request.Form["Formula_" + differentDynamicType.Value]);
- listExpandoObject.Add(dyic);
- }
- submitedScoreDetailView.TotalScore = Convert.ToDecimal(Request.Form["TotalScore"]);
- submitedScoreDetailView.ScoreCredit = Convert.ToDecimal(Request.Form["ScoreCredit"]);
- submitedScoreDetailView.GradePoint = Convert.ToDecimal(Request.Form["GradePoint"]);
- submitedScoreDetailView.Remarks = Request.Params["hid_SaveType"];//识别是否是复制性新增操作~~
- submitedScoreDetailView.StudentScoreRemark = Request.Form["Remark"];
- //Request.Params["changedUserID"] = submitedScoreDetailView.UserID.ToString();
- StudentScoreServices.StudentScoreAdd(submitedScoreDetailView, listExpandoObject);
- return Json(new ReturnMessage<Guid?>
- {
- IsSuccess = true,
- Message = "保存成功!",
- Data = submitedScoreDetailView.UserID
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败:" + ex.Message
- });
- }
- }
- public ActionResult Edit(Guid? submitedScoreID)
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current; //获取当前登录用户
- Guid curUserID = curUser.UserID;
- var schoolYear = SchoolYearServices.GetSchoolYearIsCurrent(true);//获取当前学年学期
- Guid schoolYearID = schoolYear.SchoolyearID;
- Guid? departmentID = StudentScoreServices.GetDepartmentByUserID(curUserID);
- List<Dictionary<string, string>> listDictionary = new List<Dictionary<string, string>>();
- var scoreDynamicTypes = DictionaryHelper.GetDictionaryValue(DictionaryItem.CF_ScoreType);
- int examsState = (int)CF_ExamsState.NormalExams;
- List<int?> examsStateList = StudentScoreServices.GetNormalExamsState();
- SubmitedScoreDetailView submitedScoreDetailView = new SubmitedScoreDetailView();
- var scoreDigitCount = ParameterServices.GetParameterValue<int>(CF_ParameterType.ScoreDigitCount) ?? 1;
- if (submitedScoreID.HasValue)
- {
- submitedScoreDetailView = CourseGradeServices.GetSubmitedScoreDetailView(submitedScoreID);
- ER_SubmitedScore submitedScore = CourseGradeServices.GetSubmitedScore(submitedScoreID);
- var listSubmitedScoreDetail = submitedScore.ER_SubmitedScoreDetail.ToList();
- foreach (var scoreDynamicType in scoreDynamicTypes)
- {
- ER_SubmitedScoreDetail submitedScoreDetail = listSubmitedScoreDetail.Where(x => x.ScoreTypeID == scoreDynamicType.Value).FirstOrDefault();
- listDictionary.Add(new Dictionary<string, string> { { "Formula_" + submitedScoreDetail.ScoreTypeID, submitedScoreDetail.Score == null ? "" : submitedScoreDetail.Score.ToString() } });//平时、实验、考试成绩为空时显示为0
- }
- if (examsStateList.Any(x => x.Value == submitedScoreDetailView.ExamsStateID))
- {
- if (submitedScoreDetailView.ResultTypeID == (int)CF_ResultType.Percentage)
- {
- if (scoreDigitCount > 0)
- {
- if (scoreDigitCount > 1)
- {
- submitedScoreDetailView.TotalScore = Math.Round((decimal)submitedScoreDetailView.TotalScore, scoreDigitCount);
- //listDictionary.RemoveAll(x => x.Keys.Contains("TotalScore"));
- listDictionary.Add(new Dictionary<string, string> { { "TotalScore", submitedScoreDetailView.TotalScore.ToString() } });
- }
- else
- {
- submitedScoreDetailView.TotalScore = Math.Round((decimal)submitedScoreDetailView.TotalScore, scoreDigitCount);
- //listDictionary.RemoveAll(x => x.Keys.Contains("TotalScore"));
- listDictionary.Add(new Dictionary<string, string> { { "TotalScore", submitedScoreDetailView.TotalScore.ToString() } });
- }
- }
- else
- {
- submitedScoreDetailView.TotalScore = Math.Round((decimal)submitedScoreDetailView.TotalScore, scoreDigitCount);
- //listDictionary.RemoveAll(x => x.Keys.Contains("TotalScore"));
- listDictionary.Add(new Dictionary<string, string> { { "TotalScore", submitedScoreDetailView.TotalScore.ToString() } });
- }
- //listDictionary.Add(new Dictionary<string, string> { { "TotalScore", submitedScoreDetailView.TotalScore.ToString() } });
- }
- else {
- string totalStr = StudentScoreServices.GetResultTypeDetailByIDandScore((int)submitedScoreDetailView.ResultTypeID, (decimal)submitedScoreDetailView.TotalScore).Name;
- submitedScoreDetailView.ResultTypeDetailID = StudentScoreServices.GetResultTypeDetailByIDandScore((int)submitedScoreDetailView.ResultTypeID, (decimal)submitedScoreDetailView.TotalScore).ResultTypeDetailID;
- listDictionary.Add(new Dictionary<string, string> { { "TotalScore", submitedScoreDetailView.TotalScore.ToString() } });
- }
- }
- else
- {
- string totalStr = IdNameExt.GetDictionaryItem(DictionaryItem.CF_ExamsState.ToString()).Where(x => x.Value == submitedScoreDetailView.ExamsStateID).Select(x => x.Name).FirstOrDefault();
- listDictionary.Add(new Dictionary<string, string> { { "TotalScore", totalStr } });
- }
- }
- else
- {
- if (Request["UserID"].ToString() != null && Request["UserID"].ToString() != "")
- submitedScoreDetailView.UserID = new Guid(Request["UserID"]);
- if (submitedScoreDetailView.UserID != null) {
- submitedScoreDetailView.ClassName = StudentScoreServices.GetClassByUserID(submitedScoreDetailView.UserID.Value);
- }
- submitedScoreDetailView.ResultTypeID = (int)CF_ResultType.TwoGrade;
- foreach (var scoreDynamicType in scoreDynamicTypes)
- {
- listDictionary.Add(new Dictionary<string, string> { { "Formula_" + scoreDynamicType.Value, "" } });
- }
- listDictionary.Add(new Dictionary<string, string> { { "TotalScore", "" } });
- submitedScoreDetailView.SchoolyearID = schoolYearID;
- submitedScoreDetailView.ExamsCategoryID = (int)CF_ExamsCategory.FinalExam;
- submitedScoreDetailView.ExaminationModeID = (int)CF_ExaminationMode.WrittenExam;
- submitedScoreDetailView.ExamsStateID = (int)CF_ExamsState.NormalExams;
- submitedScoreDetailView.CreatorUserID = curUserID;
- submitedScoreDetailView.DepartmentID = departmentID;
- }
- //var scoreDigitCount = ParameterServices.GetParameterValue<int>(CF_ParameterType.ScoreDigitCount) ?? 1;
- if (scoreDigitCount > 0)
- {
- if (scoreDigitCount > 1)
- {
- submitedScoreDetailView.TotalScorePattern = @"^\d+(\.\d{1," + scoreDigitCount.ToString() + "})?$";
- submitedScoreDetailView.TotalScorePatternError = "请输入整数或1-" + scoreDigitCount.ToString() + "位小数。";
- //submitedScoreDetailView.TotalScore = Math.Round((decimal)submitedScoreDetailView.TotalScore, scoreDigitCount);
- //listDictionary.RemoveAll(x => x.Keys.Contains("TotalScore"));
- //listDictionary.Add(new Dictionary<string, string> { { "TotalScore", submitedScoreDetailView.TotalScore.ToString() } });
- }
- else
- {
- submitedScoreDetailView.TotalScorePattern = @"^\d+(\.\d{1}(0{0,1}))?$";
- submitedScoreDetailView.TotalScorePatternError = "请输入整数或1位小数。";
- //submitedScoreDetailView.TotalScore = Math.Round((decimal)submitedScoreDetailView.TotalScore, scoreDigitCount);
- //listDictionary.RemoveAll(x => x.Keys.Contains("TotalScore"));
- //listDictionary.Add(new Dictionary<string, string> { { "TotalScore", submitedScoreDetailView.TotalScore.ToString() } });
- }
- }
- else
- {
- submitedScoreDetailView.TotalScorePattern = @"^\d+(\.0{1,2})?$";
- submitedScoreDetailView.TotalScorePatternError = "请输入整数。";
- //submitedScoreDetailView.TotalScore = Math.Round((decimal)submitedScoreDetailView.TotalScore, scoreDigitCount);
- //listDictionary.RemoveAll(x => x.Keys.Contains("TotalScore"));
- //listDictionary.Add(new Dictionary<string, string> { { "TotalScore", submitedScoreDetailView.TotalScore.ToString() } });
- }
- ViewBag.ListDictionary = listDictionary;
- ViewBag.ScoreDynamicTypes = scoreDynamicTypes;
- ViewBag.ResultTypeDetailID = submitedScoreDetailView.ResultTypeDetailID;
- return View(submitedScoreDetailView);
- }
- /// <summary>
- /// 编辑
- /// </summary>
- /// <param name="submitedScoreDetailView"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit(SubmitedScoreDetailView submitedScoreDetailView)
- {
- try
- {
- int atype = Convert.ToInt32(Request.Form["hid_atype"]);
- List<ExpandoObject> listExpandoObject = new List<ExpandoObject>();
- var differentDynamicTypes = DictionaryHelper.GetDictionaryValue(DictionaryItem.CF_ScoreType);
- decimal? Score = 0;
- foreach (var differentDynamicType in differentDynamicTypes)
- {
- dynamic dyic = new ExpandoObject();
- dyic.ScoreTypeID = differentDynamicType.Value;
- dyic.Score = Request.Form["Formula_" + differentDynamicType.Value];
- listExpandoObject.Add(dyic);
- }
- string totalScore = Request.Form["TotalScore"];
- if (submitedScoreDetailView.ResultTypeID == (int)CF_ResultType.Percentage || submitedScoreDetailView.ResultTypeID == -1)
- {
- submitedScoreDetailView.TotalScore = Convert.ToDecimal(Request.Form["TotalScore"]);
- }
- else if (submitedScoreDetailView.ResultTypeDetailID != null)
- {
- Score = StudentScoreServices.GetResultTypeDetailByDetaliID((Guid)submitedScoreDetailView.ResultTypeDetailID).Score;
- submitedScoreDetailView.TotalScore = Score;
- }
- submitedScoreDetailView.ScoreCredit = Convert.ToDecimal(Request.Form["ScoreCredit"]);
- submitedScoreDetailView.GradePoint = Convert.ToDecimal(Request.Form["GradePoint"]);
- submitedScoreDetailView.Remarks = Request.Params["hid_SaveType"];//识别是否是复制性新增操作~~
- submitedScoreDetailView.StudentScoreRemark = Request.Form["Remark"];
- //Request.Params["changedUserID"] = submitedScoreDetailView.UserID.ToString();
- StudentScoreServices.StudentScoreAdd(submitedScoreDetailView, listExpandoObject);
- return Json(new ReturnMessage<Guid?>
- {
- IsSuccess = true,
- Message = "保存成功!",
- Data = submitedScoreDetailView.UserID
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "保存失败:" + ex.Message
- });
- }
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="submitedScoreID"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Delete(string submitedScoreIDs, Guid? schoolyearID, Guid? coursematerialID, int? starttermID, Guid? userID)
- {
- try
- {
- List<Guid> list = new List<Guid>();
- for (int i = 0; i < submitedScoreIDs.Split(',').Length; i++)
- {
- if (!string.IsNullOrEmpty(submitedScoreIDs.Split(',')[i]))
- {
- Guid submitedScoreID = new Guid(submitedScoreIDs.Split(',')[i]);
- list.Add(submitedScoreID);
- }
- }
- CourseGradeServices.SubmitedScoreDelete(list, schoolyearID, coursematerialID, starttermID, userID);
- return Json("删除成功");
- }
- catch (Exception ex)
- {
- return Json("删除失败,原因:" + ex.Message);
- }
- }
- [HttpPost]
- public ActionResult GetClassNameByUserID(Guid userID)
- {
- string className = StudentScoreServices.GetClassByUserID(userID);
- //return Json(StudentScoreServices.GetClassByUserID(userID));
- return Json(new ReturnMessage { IsSuccess = true, Message = className });
- }
- [HttpPost]
- public ActionResult GetTypeNameByID(int typeID)
- {
- //ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- return Json(StudentScoreServices.GetResultTypeDetail(typeID));
- }
- }
- }
|