| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using CallCenter.Utility;
- using CallCenterApi.Interface.Controllers.Base;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- namespace CallCenterApi.Interface.Controllers.SystemManage
- {
- public class WorkOffDaysController : BaseController
- {
- BLL.T_Sys_WorkOFFDays dBLL = new BLL.T_Sys_WorkOFFDays();
- //获取休息日列表
- public ActionResult GetList()
- {
- List<Model.T_Sys_WorkOFFDays> wodlist = dBLL.GetModelList(" F_OffState=0 order by F_OffDate desc");
- var obj = wodlist.Select(wol => new
- {
- start = wol.F_OffDate,
- });
- return Success("", obj);
- }
- /// <summary>
- /// 设置或取消休息日
- /// </summary>
- /// <param name="offdate">日期</param>
- /// <param name="type">0,设为休息日;1,取消休息日</param>
- /// <returns></returns>
- public ActionResult setOfforOn(string offdate, int type)
- {
- if (!string.IsNullOrWhiteSpace(offdate))
- {
- int userId = CurrentUser.UserData.F_UserId;
- if (type == 0)
- {//设为休息日
- Model.T_Sys_WorkOFFDays dModel = new Model.T_Sys_WorkOFFDays();
-
- dModel.F_OffDate = Convert.ToDateTime(offdate);
- dModel.F_OffState = 0;
- dModel.F_CreateBy = userId.ToString();
- dModel.F_CreateOn = DateTime.Now;
- int n = dBLL.Add(dModel);
- if (n > 0)
- {
- return Success("添加成功", n);
- }
- else
- {
- return Error("添加失败");
- }
- }
- else
- {//取消休息日
- if (dBLL.DeleteByDate(offdate))
- {
- return Success("删除成功");
- }
- else
- return Error("删除失败");
- }
- }
- else
- {
- return Error("请选择要删除的记录");
- }
- }
- }
- }
|