public override void Execute(INotification notification) { LoginVO lv = notification.Body as LoginVO; LoginProxy temp = Facade.RetrieveProxy("LoginProxy") as LoginProxy; temp.Login(lv); }
public bool CheckLogin(LoginVO userInfo) { Debug.Log("userInfo = " + userInfo); Dictionary <string, string> localData = GetLocalData(); string userName = userInfo.Name; if (null == userName || userName.Trim().Length == 0) { return(false); } string pass = userInfo.Pwd; if (null == pass || pass.Trim().Length == 0) { return(false); } if (!localData.ContainsKey(userName)) { return(false); } if (!pass.Equals(localData[userName])) { return(false); } return(true); }
void Signup(object sender, EventArgs e) { LoginArgs args = (LoginArgs)e; string name = args.Name; string pass = args.Pwd; LoginVO user = new LoginVO(); user.username = name; user.password = pass; user.email = "*****@*****.**"; //GameMain.instance.bmob.Signup<LoginVO>(user, (resp, exception) => //{ // if (exception != null) // { // Debug.LogError("注册失败, 失败原因为: " + exception.Message); // return; // } // Debug.Log("注册成功"); //}); Facade.NotifyObservers(new Notification(LoginFacade.SUBMIT_SIGNUP, user, null)); }
public object FindByLogin(LoginVO login) { bool credentialValid = false; if (login != null && !string.IsNullOrWhiteSpace(login.Login)) { var baseUser = _respository.FindByLogin(login.Login); credentialValid = (baseUser != null && login.Login == baseUser.Login && login.AccessKey == baseUser.AccessKey); } if (credentialValid) { ClaimsIdentity identity = new ClaimsIdentity( new GenericIdentity(login.Login, "Login"), new[] { new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString("N")), new Claim(JwtRegisteredClaimNames.UniqueName, login.Login) } ); var createDate = DateTime.Now; var expirationDate = createDate + TimeSpan.FromSeconds(_token.Seconds); var handler = new JwtSecurityTokenHandler(); string tokenValue = CreateToken(identity, createDate, expirationDate, handler); return(SuccessObject(createDate, expirationDate, tokenValue)); } else { return(ExceptionObject()); } }
public ActionResult Login(LoginVO model) { if (ModelState.IsValid) { BusinessLayerResult <EvernoteUser> blr = eum.LoginUser(model); if (blr.Informations.Count > 0) { List <string> infoList = new List <string>(); blr.Informations.ForEach(x => infoList.Add(x.Value)); ViewBag.InfoList = infoList; } if (blr.Errors.Count > 0) { blr.Errors.ForEach(x => ModelState.AddModelError("", x.Value)); return(View(model)); } CurrentSession.Set <EvernoteUser>("login", blr.Result); return(RedirectToAction("Index")); } return(View(model)); }
//Get idClient by User + Pass and return VO public LoginVO getUser(string _username, string _password) { LoginVO userVO = new LoginVO(); DataTable dataTable = new DataTable(); try { dataTable = _loginDAO.searchByUserPass(_username, _password); foreach (DataRow dr in dataTable.Rows) { userVO.idUser = Int32.Parse(dr["idUser"].ToString()); userVO.idClient = Int32.Parse(dr["idClient"].ToString()); userVO.username = dr["Username"].ToString(); userVO.password = dr["Password"].ToString(); userVO.type = dr["Type"].ToString(); } } catch (NullReferenceException e) { Console.Write("Error:", e.ToString()); Console.ReadLine(); } return(userVO); }
private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtLoginEmail.Text)) { MessageBox.Show("이메일을 입력해주세요."); return; } if (string.IsNullOrEmpty(txtLoginPassword.Text)) { MessageBox.Show("비밀번호를 입력해주세요."); return; } var login = new LoginVO() { grant_type = "password", email = txtLoginEmail.Text, password = txtLoginPassword.Text }; string token = ANBTX.WebRequestCheck(BASE_URL[0] + BASE_SURV_URL[0], login); if (ANBTX.TokenValue(token) != null) { var frmRestHome = new FrmRestAPITest(); frmRestHome.ShowDialog(); this.Hide(); // var frmMainViewList = new FrmMainViewList(); // frmMainViewList.Show(); // this.Hide(); } }
public object FindByLogin(LoginVO login) { bool credentialIsValid = false; if (login != null && !string.IsNullOrWhiteSpace(login.Username)) { var baseLogin = _repository.FindByLogin(login.Username); credentialIsValid = (baseLogin != null && login.Username == baseLogin.Username && login.Password == baseLogin.Password); } if (credentialIsValid) { ClaimsIdentity identity = new ClaimsIdentity( new GenericIdentity(login.Username, "Username"), new [] { new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString("N")), new Claim(JwtRegisteredClaimNames.UniqueName, login.Username) } ); DateTime createDate = DateTime.Now; DateTime expirationDate = createDate + TimeSpan.FromSeconds(_tokenConfiguration.Seconds); var handler = new JwtSecurityTokenHandler(); string token = CreateToken(identity, createDate, expirationDate, handler); return(SuccessObject(createDate, expirationDate, token)); } else { return(ExceptionObject()); } }
public ICommandResult Post([FromBody] AutenticarUsuarioBaseCommand command) { var login = new LoginVO(command.Usuario, command.Senha); if (login.Invalid) { return(new CommandResult(false, "Por favor, corrigir os campos abaixo", login.Notifications)); } _usuarioBase = _repository.UsuarioBase(login.Usuario, login.Senha); if (_usuarioBase == null) { return(new CommandResult(false, "Falha ao autenticar. Usuário e/ou senha inválidos", new { })); } var senhaTemporaria = _repository.BuscarUsuarioSenhaTemporaria(_usuarioBase.Id); if (senhaTemporaria != null) { if (DateTime.Now.Subtract(senhaTemporaria.DataCadastro).Days >= 1) { if (senhaTemporaria.Ativo == EBoolean.True) { return(new CommandResult(false, "Sua senha temporária expirou. Favor, Solicitar uma nova senha.", new { })); } } } return(Autenticar); }
protected override void Parse(string data) { base.Parse(data); string[] textColumn = data.Split("\n".ToCharArray()); obj = new object[textColumn.Length]; for (int i = 1; i < textColumn.Length; i++) { string[] textRow = textColumn[i].Split(" ".ToCharArray()); LoginVO vo = new LoginVO(); for (int j = 0; j < textRow.Length; j++) { vo.card_id = int.Parse(textRow[0]); vo.card_atlas = textRow[1]; vo.card_name = textRow[2]; } obj[i] = vo; dic.Add(vo.card_id, vo); } }
public UsuarioBaseTeste() { _documentoVO = new DocumentoVO("181.091.714-00"); _emailVO = new EmailVO("*****@*****.**"); _loginVO = new LoginVO("jamil", "jaja123"); _usuarioBase = new UsuarioBase(_loginVO, _emailVO, _documentoVO, EPerfilAcessoSistema.Usuario, @"C:\impr"); }
public LoginWindow() { InitializeComponent(); _loginBUS = new LoginBus(); _accDAO = new BankAccountDAO(); _loginVO = new LoginVO(); }
public override void Execute(INotification notification) { UsersProxy usersProxy = (UsersProxy)Facade.RetrieveProxy(UsersProxy.NAME); LoginVO user = (LoginVO)notification.Body; //if(usersProxy.CheckLogin(userInfo)) //{ // SendNotification(LoginFacade.LOGIN_SUCCESSFUL, null, null); //} //else //{ // SendNotification(LoginFacade.LOGIN_FAIL, null, null); //} GameMain.instance.bmob.Login <LoginVO>(user.username, user.password, (resp, exception) => { if (exception != null) { string info = "登录失败, 失败原因为: " + exception.Message; SendNotification(LoginFacade.LOGIN_FAIL, info, null); return; } string msg = "登录成功, @" + resp.username + "$[" + resp.sessionToken + "]"; SendNotification(LoginFacade.LOGIN_SUCCESSFUL, msg, null); }); }
private void button1_Click(object sender, EventArgs e) { btnLogin.DialogResult = DialogResult.OK; LoginService service = new LoginService(); UserLoginService loginService = new UserLoginService(); LoginVO loginVo = new LoginVO(); loginVo.User_ID = Convert.ToInt32(txtID.Text); loginVo.User_PW = txtPwd.Text; List <LoginVO> list = new List <LoginVO>(); list = service.LoginOK(loginVo); if (list.Count > 0) { //btnLogin.DialogResult = DialogResult.OK; Global.LoginID = list[0].User_ID; Global.Authority = list[0].Pre_Type; MainForm frm = new MainForm(this); loginService.InsertLoginMES(Global.LoginID); frm.Show(); this.Hide(); } else { MessageBox.Show("로그인에 실패했습니다."); btnLogin.DialogResult = DialogResult.Cancel; } }
private void login_Click(object sender, EventArgs e) { this._loginVO = this._loginBUS.getUser(textUser.Text, textPassw.Text); if (this._loginVO.type == null) { MessageBox.Show("Incorrect username or password!", "Not Found", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (this._loginVO.type == "Customer") { //MessageBox.Show(_loginVO.idClient.ToString(), "Result", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); FormClient fc = new FormClient(); fc.setId(this._loginVO.idClient); DataGridView dataGrid = fc.getGrid(); fc.refreshGrid(this._loginVO.idClient); fc.Show(); } else { this.Hide(); FormAdmin fa = new FormAdmin(); fa.refreshGrid(); fa.Show(); } }
public LoginVO Update(LoginVO login) { var loginEntity = _converter.Parse(login); loginEntity = _repository.Update(loginEntity); return(_converter.Parse(loginEntity)); }
//로그인 // 운영으로 들어갈 경우를 위해 URL을 남겨둠 public static string WebRequestCheck(String strAPI, LoginVO check) { StringBuilder dataParam = new StringBuilder(); dataParam.Append("grant_type=" + check.grant_type.ToString()); dataParam.Append("&username="******"&password="******"POST"; loginCheck.Accept = "application/json"; loginCheck.Headers.Add(HttpRequestHeader.Authorization, "Basic YW5iZGV2Y2VudGVyLWNsaWVudC13aXRoLXNlY3JldDpkZXZjZW50ZXI="); loginCheck.ContentType = "application/x-www-form-urlencoded"; Stream stDataParams = loginCheck.GetRequestStream(); stDataParams.Write(byteDataParams, 0, byteDataParams.Length); stDataParams.Close(); HttpWebResponse resLogin = (HttpWebResponse)loginCheck.GetResponse(); Stream stReadData = resLogin.GetResponseStream(); StreamReader srReadData = new StreamReader(stReadData, Encoding.Default); return(srReadData.ReadToEnd()); }
public object Post([FromBody] LoginVO usuario) { if (usuario == null) { return(BadRequest()); } return(_loginBusiness.FindByLogin(usuario)); }
public object Post([FromBody] LoginVO login) { if (login == null) { return(BadRequest()); } return(_loginBusiness.FindByLogin(login)); }
public void Login(LoginVO tryLogin) { LoginVO.username = tryLogin.username; LoginVO.password = tryLogin.password; Debug.LogError(LoginVO.username + "--" + LoginVO.password); //发送消息,这里直接返回true OnResult(true); }
public IActionResult Create([FromBody] LoginVO login) { if (login.Usuario == null && login.Senha == null) { return(BadRequest()); } return(new ObjectResult(_loginService.Create(login))); }
public LoginVO GetInputLoginVO() { var loginVO = new LoginVO(); loginVO.UserName = userNameInputField.text; loginVO.Password = passwordInputField.text; return(loginVO); }
public void Inicia_UsuarioBaseVO_INVALIDO() { _documentoVO = new DocumentoVO("181.091.714-00"); _emailVO = new EmailVO("*****@*****.**"); _loginVO = new LoginVO("ja", "jaja"); // <- Usuário inválido _usuarioBase = new UsuarioBase(_loginVO, _emailVO, _documentoVO, EPerfilAcessoSistema.Usuario, @"C:\impr"); Assert.AreEqual(true, _usuarioBase.Invalid); }
public override void Execute(INotification notification) { LoginVO loginVo = new LoginVO(); loginVo = notification.Body as LoginVO; UserLoginProxy userLoginProxy = (UserLoginProxy)AppFacade.GetInstance().RetrieveProxy(UserLoginProxy.NAME); userLoginProxy.LoginToData(loginVo.Id, loginVo.Pwd); }
void Login(object sender, EventArgs e) { LoginArgs args = (LoginArgs)e; string name = args.Name; // dialog.userName.getText(); string pass = args.Pwd; // new string(dialog.password.getPassword()); LoginVO userInfo = new LoginVO(name, pass); Facade.NotifyObservers(new Notification(LoginFacade.SUBMIT_LOGIN, userInfo, null)); }
public void AtribuirUsuario( LoginVO loginVO, EmailVO emailVO, DocumentoVO documentoVO) { this.Login = loginVO; this.Email = emailVO; this.Documento = documentoVO; }
public LoginVO GetLoginVO() { if (null == m_LoginVO) { m_LoginVO = new LoginVO(); } m_LoginVO.username = m_UserName.text; m_LoginVO.password = m_UserPassword.text; return(m_LoginVO); }
public LoginDelegate(IResponder _responder, LoginVO _loginVO) { WWWForm form = new WWWForm(); form.AddField("username", _loginVO.userName); form.AddField("password", _loginVO.password); m_responder = _responder; m_httpService = new HttpService(Const.Url.CONTROL_CENTER_LOGIN, HttpRequestType.Post, form); }
public async Task <IActionResult> Login(LoginVO vo) { var checkResult = await _administratorService.LoginCheckAsync(vo.UserName, vo.Password); if (checkResult.Success) { var userBo = checkResult.Data as UserBO; await SignIn(userBo); } return(Json(checkResult)); }
public LoginVO Consult(LoginVO login) { var loginEntity = _converter.Parse(login); loginEntity = _repository.Consult(loginEntity); if (loginEntity != null) { return(_converter.Parse(loginEntity)); } return(null); }
public bool CheckLogin(LoginVO userInfo) { Debug.Log("userInfo = " + userInfo); Dictionary<string, string> localData = GetLocalData(); string userName = userInfo.username; if(null==userName||userName.Trim().Length==0) return false; string pass = userInfo.password; if(null==pass||pass.Trim().Length==0) return false; if(!localData.ContainsKey(userName)) return false; if(!pass.Equals(localData[userName])) return false; return true; }
void Login(object sender, EventArgs e) { LoginArgs args = (LoginArgs)e; string name = args.Name; string pass = args.Pwd; LoginVO userInfo = new LoginVO(); userInfo.username = name; userInfo.password = pass; userInfo.email = "*****@*****.**"; Facade.NotifyObservers(new Notification(LoginFacade.SUBMIT_LOGIN, userInfo, null)); }
private void onSuccess(BaseWWWRequest obj) { try { this.loginVO = new JsonFx.Json.JsonReader().Read<LoginVO>(this.UTF8String); if (this.loginVO.eid != 0) { this.onFail(obj); } else { GameData.instance.LoginInfo = this.loginVO; ServerRequestManager.instance.OnLoginSuccess(); } } catch (Exception) { this.onFail(obj); } }
public void CompleteResetGameData() { this._loginInfo = null; this._userInfo = null; this._userFleets = null; this._userShips = null; this._userItemsDic = null; this._userEquipmentDic = null; this._userDocks = null; this._userEquipDocks = null; this._userRepairDocks = null; this._userRepairDic = null; this.shipsDic = null; this._shipBuildLogs = null; this._equipBuildLogs = null; this._unlockedCards = null; this.lastUpdatePVPTime = new DateTime(0x7c6, 1, 1); this._pvpOpponents = null; this._allQuests = null; this.lastUpdateQuestTime = new DateTime(0x7c6, 1, 1); this.lastUpdateLeaderBoardTime = new DateTime(0x7c6, 1, 1); this._lastGetBuildLogTime = new DateTime(0x7c6, 1, 1); this._lastGetEquipBuildLogTime = new DateTime(0x7c6, 1, 1); this._leaderBoardData = null; this.IsCampaignDataInited = false; this._openedCampaignLevels = null; this._campaignChapterTimesInfo = null; this._campaignFleets = null; this._totalCampainInfo = null; this.shopItemCanBuyStatus = null; this.passedEventNodeIds = null; this.haveGotPVEEventData = false; this.passedPVEEventLevels = null; this.passedPVEEventLevelsDic = null; this.ResetPVEData(); }
private void onSuccess(BaseWWWRequest obj) { try { if (this.needZip) { this.loginVO = JsonReader.Deserialize<LoginVO>(base.UTF8String); } else { this.loginVO = JsonReader.Deserialize<LoginVO>(base.www.text); } if (this.loginVO.eid != 0) { this.onFail(obj); } else { GameData.instance.LoginInfo = this.loginVO; ServerRequestManager.instance.OnLoginSuccess(); } } catch (Exception) { this.onFail(obj); } }