/// <summary> /// 로그인 시도 /// </summary> /// <param name="obj">패스워드 Entry 객체</param> private async void LoginExecuteMethod(object obj) { string pw = (obj as Entry).Text; if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(pw)) { MessageService.Show(ErrorMessage.empty); return; } EncryptoService encryptoService = new EncryptoService(); pw = encryptoService.Generate(pw); string responseToken = await webService.SendGet(Urls.SIGNIN, id, pw); if (string.IsNullOrEmpty(responseToken)) { MessageService.Show(ErrorMessage.notMember); return; } propertyService.Write(Property.User.token, responseToken); propertyService.Write(Property.User.email, id); App.Current.MainPage = new HomeView(); }
/// <summary> /// 회원가입 시도 /// </summary> /// <param name="obj">패스워드 Entry 객체</param> private async void SignUpExecuteMethod(object obj) { string pw = (obj as Entry).Text; if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(pw)) { MessageService.Show(ErrorMessage.empty); return; } EncryptoService encryptoService = new EncryptoService(); pw = encryptoService.Generate(pw); Dictionary <string, string> value = new Dictionary <string, string>(); value.Add(Property.User.email, id); value.Add(Property.User.password, pw); string result = await webService.SendPost(Urls.SIGNUP, value); if (string.IsNullOrEmpty(result)) { MessageService.Show(ErrorMessage.existUser); return; } MessageService.Show(SuccessMessage.signUp); App.Current.MainPage = new LoginView(); }