using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NP.Model;
using System.Collections;
using NP.Base.Auth;
using NP.Base.ENUM;
using System.Text.RegularExpressions;
namespace NP.Base.Controllers
{
///
/// 관리자권한, antitoken필요로하는 ajax호출
///
[NP.Base.Auth.CFilter]
public partial class ACommonController : NP.Base.BaseController
{
protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
base.OnActionExecuting(filterContext);
}
protected override void OnException(ExceptionContext filterContext)
{
base.OnException(filterContext);
if (Request.IsAjaxRequest())
{
filterContext.Result = new RedirectResult("/Account/NoPermit?_code=" + NP.Base.ENUM.JSONCode.Error + "&_msg=알수없는오류");
}
else
{
filterContext.Result = new RedirectResult("/Account/Error?_code=" + NP.Base.ENUM.JSONCode.Error + "&_msg=알수없는오류");
}
}
[HttpPost]
public JsonResult SaveUserAuth(String authname)
{
return JsonOK(Dao.Save("sys.userauth.save", new Hashtable() { { "authname",authname} ,{"uno",SUserInfo.UserNo },{ "uip",GetUserIP()} }));
}
[HttpPost]
public JsonResult SaveAuthName(String authname,int usertype)
{
return JsonOK(Dao.Save("sys.authname.save", new Hashtable() { { "authname", authname }, { "usertype",usertype},{ "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
}
[HttpPost]
public JsonResult DelUserAuth(int usertype,String authname)
{
return JsonOK(Dao.Save("sys.userauth.del", new Hashtable() {{ "usertype", usertype },{ "authname",authname}, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }));
}
[HttpPost]
public JsonResult GetMenu(int mno)
{
return JsonBack