public async void RequestLogin(String id, String pw) { Req0003 req = new Req0003() { UserID = id, Password = pw }; Res0003 res = await GGTHubProxy.Invoke <Res0003>("RequestLogin", req); Packet0003Received?.Invoke(this, new Packet0003ReceivedEventArgs(req, res)); }
public Res0003 RequestLogin(Req0003 req) { String LoginUserName = Singleton <DatabaseService> .Instance.GetUserName(req.UserID, req.Password); String Message = String.Empty; Res0003 res = null; if (!String.IsNullOrWhiteSpace(LoginUserName)) { String UserStatus = Singleton <DatabaseService> .Instance.GetUserStatus(req.UserID); if (UserStatus.Equals("O")) { Boolean ConnectionIDUpdateResult = Singleton <DatabaseService> .Instance.UpdateConnectionID(req.UserID, this.Context.ConnectionId); Boolean UserLoginUpdateResult = Singleton <DatabaseService> .Instance.UpdateUserLogin(req.UserID); if (ConnectionIDUpdateResult & UserLoginUpdateResult) { UserStatus = Singleton <DatabaseService> .Instance.GetUserStatus(req.UserID); if (UserStatus.Equals("X")) { res = new Res0003() { Request = req, IsLoginSuccess = true, UserName = LoginUserName, Message = "로그인 성공" } } ; else { res = new Res0003() { Request = req, IsLoginSuccess = false, UserName = LoginUserName, Message = "로그인에 성공했으나 연결ID 갱신 문제 발생" } }; } else { res = new Res0003() { Request = req, IsLoginSuccess = false, UserName = LoginUserName, Message = "로그인에 성공했으나 DB 갱신 문제 발생" }; } } else { res = new Res0003() { Request = req, IsLoginSuccess = false, UserName = LoginUserName, Message = "이미 로그인 상태입니다" }; } } else { res = new Res0003() { Request = req, IsLoginSuccess = false, Message = "ID 또는 Password가 일치하지 않음" }; } return(res); }