using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using EMIS.CommonLogic.ScoreManage; using EMIS.ViewModel; using EMIS.Web.Controls; using Bowin.Web.Controls.Mvc; using EMIS.ViewModel.ScoreManage; namespace EMIS.Web.Controllers.ScoreManage { [Authorization] public class ProjectScoreController : Controller { public IProjectScoreServices ProjectScoreServices { get; set; } public ActionResult List() { return View(); } public ActionResult Detail(Guid projectScoreID) { return View(); } public ActionResult Generate() { return View(new ProjectScoreGenerateCondition()); } [HttpPost] public ActionResult List(QueryParamsModel pararms) { ConfiguretView conditionView = ConfiguretExtensions.GetConfiguretermsView(pararms); var schoolyearID = pararms.getExtraGuid("ddlSchoolyear"); var examinationTypeID = pararms.getExtraGuid("ddlExaminationType"); var examinationProjectID = pararms.getExtraGuid("cgbExaminationProject"); var schoolAreaID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea"); var collegeID = pararms.getExtraGuid("ddlCollege"); var yearID = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear"); var standardID = pararms.getExtraInt("cgbStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("cgbStandard"); var classmajorID = pararms.getExtraGuid("cgbClassmajor"); var hasTrain = pararms.getExtraInt("ddlIsTrain") == DropdownList.SELECT_ALL ? null : (bool?)(pararms.getExtraInt("ddlIsTrain") == (int)CF_GeneralPurpose.IsYes); return base.Json(ProjectScoreServices.GetProjectScoreViewGrid(conditionView, schoolyearID, examinationTypeID, examinationProjectID, schoolAreaID, collegeID, yearID, standardID, classmajorID, hasTrain, (int)pararms.page, (int)pararms.rows)); } [HttpPost] public ActionResult DetailList(QueryParamsModel pararms, Guid projectScoreID) { ConfiguretView conditionView = ConfiguretExtensions.GetConfiguretermsView(pararms); return base.Json(ProjectScoreServices.GetProjectScoreDetailViewGrid(conditionView, projectScoreID, (int)pararms.page, (int)pararms.rows)); } [HttpPost] public ActionResult Generate(ProjectScoreGenerateCondition conditions) { try { if (!conditions.SchoolyearID.HasValue) { return Json(new ReturnMessage() { IsSuccess = false, Message = "请输入学年学期。" }); } ProjectScoreServices.GenerateProjectScore(conditions.SchoolyearID.Value, conditions.ExaminationBatchID, conditions.ExaminationTypeID, conditions.ExaminationProjectID); return Json(new ReturnMessage() { IsSuccess = true, Message = "成绩认定完成。" }); } catch (Exception ex) { return Json(new ReturnMessage() { IsSuccess = false, Message = "成绩认定失败:" + ex.Message }); } } } }