예제 #1
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            _USession _session = new _USession();
            B_Users   objU     = new B_Users();

            if (_session.User_Id != "" || _session.User_Group != "")
            {
                if (!objU.checkAuthorization(_session.User_Group, Function_Id))
                {
                    filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary
                    {
                        { "controller", "Home" },
                        { "action", "Error" }
                    });
                }
            }
            else
            {
                filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary
                {
                    { "controller", "Home" },
                    { "action", "Login" }
                });
            }
            base.OnActionExecuting(filterContext);
        }
예제 #2
0
        public JsonResult Login(M_Login login)
        {
            string result  = "Error";
            var    loggedU = objUser.getUserLogin(login);

            if (loggedU != null)
            {
                _USession Session = new _USession();
                Session.Customer_ID       = loggedU.Customer_ID;
                Session.User_Id           = loggedU.User_ID;
                Session.User_Group        = loggedU.UserGroup_ID;
                Session.Person_Name       = loggedU.Person_Name;
                Session.PFX_path          = "~/Signature/DesmondM/W_M_S_L_Weerasinghe_NCE.pfx";
                Session.SignatureIMG_Path = "~/Signature/DesmondM/Sachithra-Weerasinghe's_signature_in_high_res.png";

                result = "Succes";
            }
            else
            {
                result = "Failed";
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }