public ActionResult Rest() { string method = CECRequest.GetQueryString("method").ToLower(); #region == 获得Cookie名称 == if (method == "getkeynameincookies") { ILoginAdapter la = new LoginAdapter(); return(Content(la.CookieName)); } #endregion #region == 获得Cookie值 明文 == if (method == "getvalueincookies") { string encryptCookieValue = CECRequest.GetQueryString("Password"); ILoginAdapter la = new LoginAdapter(); string[] value = la.GetCookieValue(encryptCookieValue).Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries); if (value.Length > 5) { return(Content(value[1])); //用户名 } } #endregion return(Content(string.Empty)); }
public GameProcessSystem(IGameSetting gameSetting, ISceneSystem sceneSystem, IUIController uiController, LoginAdapter loginAdapter) { this.gameSetting = gameSetting; this.sceneSystem = sceneSystem; this.uiController = uiController; this.loginAdapter = loginAdapter; context = new GameProcessContext(); }
public void Logout() { ILoginAdapter login = new LoginAdapter(); login.LoginOut(); Response.Redirect("/"); Response.End(); }
public void SetUp() { IAppLogger <Car> appLoger = new LoginAdapter <Car>(); var dbContext = new Moq.Mock <CarDbContext>(); IRepository <Car> carRepository = new EfRepostiory <Car>(dbContext.Object); IAsyncRepository <Car> carRepositoryAsync = new EfRepostiory <Car>(dbContext.Object); _CarRepository = new CarRepository(carRepositoryAsync, carRepository, appLoger); }
public PlantEngContext() { ILoginAdapter login = new LoginAdapter(); if (login.IsClientLogin()) { LoginUserInfo = login.GetLoginedUserInfo(); } }
private void _Login(MemberInfo userInfo) { ILoginAdapter login = new LoginAdapter(); login.WriteLoginCookie(new LoginUserInfo() { Email = userInfo.Email, UserId = userInfo.Id, RoleId = (int)userInfo.Type, UserName = userInfo.UserName, Password = userInfo.Password }); }
protected override void Dispose(bool disposing) { if (this.disposed) { return; } if (!disposing) { return; } this.adapter?.Dispose(); this.adapter = null; base.Dispose(true); }
public LoginRepository(IProgressConnection connection) { this.loginAdapter = new LoginAdapter(connection); }
public HomeController() { _loginAdapter = new LoginAdapter(); _loginMapper = new LoginMapper(); }
public CUILogin(UIContainer container, IUIBaseContext baseContext, LoginAdapter loginAdapter) : base(container, baseContext) { this.loginAdapter = loginAdapter; }
public LoginRepository(IProgressConnection connection) { this.adapter = new LoginAdapter(connection); this.Cono = this.adapter.Cono; this.OnCreated(); }
public LoginService() { loginAdapter = new LoginAdapter(); }
public ActionResult Rest(FormCollection fc) { string method = CECRequest.GetQueryString("method").ToLower(); #region == 登录 == if (method == "login") { string userName = CECRequest.GetFormString("username"); string password = CECRequest.GetFormString("password"); string returnUrl = CECRequest.GetQueryString("url"); var userInfo = MemberService.Get(userName); if (userInfo.Id > 0 && userInfo.Password == password) { //写登录Cookie ILoginAdapter la = new LoginAdapter(); la.WriteLoginCookie(new LoginUserInfo() { Email = userInfo.Email, UserId = userInfo.Id, RoleId = (int)userInfo.Type, UserName = userInfo.UserName, Password = userInfo.Password }); } else { return(Content("<script type=\"text/javascript\">alert(\"用户名或密码错误,请重新输入!\");location.href = location.href;</script>")); } if (!string.IsNullOrEmpty(returnUrl)) { return(Redirect(returnUrl)); } } #endregion #region == 登出 == if (method == "logout") { string returnUrl = CECRequest.GetQueryString("url"); ILoginAdapter la = new LoginAdapter(); if (la.IsClientLogin()) { la.LoginOut(); } if (!string.IsNullOrEmpty(returnUrl)) { return(Redirect(returnUrl)); } } #endregion #region == 是否在线 == if (method == "isolineuser") { var userName = CECRequest.GetFormString("UserName"); var userPwd = CECRequest.GetFormString("PassWord"); var memberInfo = MemberService.Get(userName); if (memberInfo.Id > 0 && memberInfo.Password == userPwd) { return(Content("true")); } return(Content("false")); } #endregion #region == 获取用户信息 == if (method == "getuserinfo") { StringBuilder sb = new StringBuilder(); var userName = CECRequest.GetFormString("UserName"); var memberInfo = MemberService.Get(userName); if (memberInfo.Id > 0) { sb.Append("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); sb.Append("<root>"); sb.AppendFormat("<Email>{0}</Email>", memberInfo.Email); sb.AppendFormat("<MobilePhone>{0}</MobilePhone>", memberInfo.Mobile); sb.AppendFormat("<Realname>{0}</Realname>", memberInfo.RealName); sb.Append("</root>"); } return(Content(sb.ToString())); } #endregion return(Content(string.Empty)); }
public LoginLogic() { this.LoginData = new LoginAdapter(); this.usuario = new Usuario(); }