protected override void OnActionExecuting(ActionExecutingContext filterContext) { String ControllerName = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName.ToUpper(); String ActionName = filterContext.ActionDescriptor.ActionName.ToUpper(); String Action = string.Format("{0}Controller{1}", ControllerName, ActionName).ToUpper(); if (BaseUtil.ListControllerTocheckLogin().Contains(ControllerName)) { if (BaseUtil.GetSessionValue(AdminInfo.LoginID.ToString()) == "") { filterContext.Result = null; filterContext.Result = new RedirectResult("/Account/login"); return; } return; } }
public static string GetLoginID() { return(BaseUtil.GetSessionValue(AdminInfo.LoginID.ToString())); }
public static int GetUserID() { return(Convert.ToInt32(BaseUtil.GetSessionValue(AdminInfo.LoginID.ToString()))); }