TG.WXCRM.V4/WEB/Controllers/Res/DeptRuleController.cs

46 lines
1.1 KiB
C#

using Ninject;
using System;
using System.Collections.Generic;
using System.Web.Mvc;
using WX.CRM.Common;
using WX.CRM.IBLL.Res;
using WX.CRM.IBLL.Util;
namespace WX.CRM.WEB.Controllers.Res
{
public class DeptRuleController : BaseController
{
[Inject]
public ICACHE_Q _cache { get; set; }
[Inject]
public IRES_DEPT_RULE _deptRule { get; set; }
[HttpGet]
public ActionResult Index()
{
ViewBag.DeptList = _deptRule.GetDeptRule();
return View();
}
[HttpPost]
public JsonResult Save(string dto)
{
try
{
//LogHelper.Info(dto.ToObject<DeptRuleView>);
var list = dto.ToObject<List<DeptRuleView>>();
var ret = _deptRule.Save(list);
return Json(new { result = ret }, JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
LogHelper.Error(ex);
return Json(new { result = false }, JsonRequestBehavior.AllowGet);
}
}
}
}