Beispiel #1
0
        public void ActionLogin(LoginModel loginModel)
        {
            //if (CPLogin.CheckLogin(loginModel.UserName, loginModel.Password))
            //{
            if (CPLogin.CheckLogin1(loginModel.UserName, loginModel.Password))
            {
                CPViewPage.SetLog("Đăng nhập hệ thống.");

                if (string.IsNullOrEmpty(loginModel.ReturnPath))
                {
                    CPViewPage.CPRedirectHome();
                }
                else
                {
                    CPViewPage.Response.Redirect(CPViewPage.Server.UrlDecode(loginModel.ReturnPath));
                }
            }
            else
            {
                CPViewPage.SetLog("Tên đăng nhập '" + loginModel.UserName + "' không thành công.");

                CPViewPage.Message.MessageType = Message.MessageTypeEnum.Error;
                CPViewPage.Message.ListMessage.Add("{RS:Login_Error}");
            }
        }
        public void ActionLogout()
        {
            CPViewPage.SetLog("Thoát khỏi hệ thống.");

            CPLogin.Logout();

            CPViewPage.CPRedirect("Login.aspx");
        }