using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using EMIS.CommonLogic.CalendarManage; using EMIS.ViewModel.CalendarManage; using EMIS.ViewModel; using Bowin.Common.Utility; namespace EMIS.Web.Controllers.CalendarManage { public class CalendarController : Controller { public ICalendarViewServices CalendarViewServices { get; set; } /// /// 学年校历页面 /// /// public ActionResult Index() { return View(); } [HttpPost] public ActionResult GetCalendarView(Guid schoolYearID) { try { var calendarView = CalendarViewServices.GetCalendarViewBySchoolYearID(schoolYearID); return Json(new ReturnMessage { IsSuccess = true, Data = calendarView }); } catch (Exception ex) { return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message }); } } [HttpPost] public ActionResult Excel() { var schoolyear = Request.Form["SchoolYearDropdown"].ParseStrTo(); CalendarViewServices.Excel(schoolyear.Value, "学年校历" + DateTime.Now.ToString("yyyyMMddhhmmss")); return Json(new ReturnMessage() { IsSuccess = false, Message = "导出成功!" }); } } }