using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EMIS.ViewModel;
using EMIS.CommonLogic.CalendarManage;
using Bowin.Web.Controls.Mvc;
using EMIS.ViewModel.CalendarManage;
namespace EMIS.Web.Controllers.CalendarManage
{
[Authorization]
public class ArrangementsController : Controller
{
public IArrangementServices arrangementServices { get; set; }
///
/// 周工作表页面
///
///
public ActionResult List()
{
return View();
}
///
/// 列表
///
///
///
[HttpPost]
public ActionResult List(QueryParamsModel pararms)
{
return Json(arrangementServices.GetArrangementViewGrid());
}
///
/// 保存
///
///
[HttpPost]
public ActionResult Edit()
{
try
{
var arrangementsList = DataGrid.GetTableData("dgArrangementsList");
arrangementServices.ArrangementAdd(arrangementsList);
return Json(new ReturnMessage()
{
IsSuccess = true,
Message = "保存成功!"
});
}
catch (Exception ex)
{
return Json(new ReturnMessage()
{
IsSuccess = true,
Message = "保存失败,原因:" + ex.Message + "!"
});
}
}
[HttpPost]
public ActionResult IsOnWork(int weekday, Guid courseTimeID)
{
try
{
var isOnWork = arrangementServices.IsOnWork(weekday, courseTimeID);
return Json(isOnWork);
}
catch (Exception ex)
{
return Json(false);
}
}
}
}