private void SetDataLogin(CreatAccountObject auth) { try { Current.AccessToken = auth.AccessToken; UserDetails.Username = TxtUsername.Text; UserDetails.FullName = TxtFirstName.Text + " " + TxtLastName.Text; UserDetails.Password = TxtPassword.Text; UserDetails.AccessToken = auth.AccessToken; UserDetails.UserId = auth.UserId; UserDetails.Status = "Pending"; UserDetails.Cookie = auth.AccessToken; UserDetails.Email = TxtEmail.Text; //Insert user data to database var user = new DataTables.LoginTb { UserId = UserDetails.UserId, AccessToken = UserDetails.AccessToken, Cookie = UserDetails.Cookie, Username = UserDetails.Username, Password = UserDetails.Password, Status = "Pending", Lang = "", DeviceId = UserDetails.DeviceId, Email = UserDetails.Email, }; ListUtils.DataUserLoginList.Clear(); ListUtils.DataUserLoginList.Add(user); var dbDatabase = new SqLiteDatabase(); dbDatabase.InsertOrUpdateLogin_Credentials(user); if (Methods.CheckConnectivity()) { PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => ApiRequest.Get_MyProfileData_Api(this) }); } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void SetDataLogin(CreatAccountObject auth) { try { Current.AccessToken = auth.AccessToken; UserDetails.Username = UsernameEditText.Text; UserDetails.FullName = FirstNameEditText.Text + " " + LastNameEditText.Text; UserDetails.Password = PasswordEditText.Text; UserDetails.AccessToken = auth.AccessToken; UserDetails.UserId = auth.UserId; UserDetails.Status = "Pending"; UserDetails.Cookie = auth.AccessToken; UserDetails.Email = EmailEditText.Text; //Insert user data to database var user = new DataTables.LoginTb { UserId = UserDetails.UserId, AccessToken = UserDetails.AccessToken, Cookie = UserDetails.Cookie, Username = UserDetails.Username, Password = UserDetails.Password, Status = "Pending", Lang = "", DeviceId = UserDetails.DeviceId, Email = UserDetails.Email, }; ListUtils.DataUserLoginList.Clear(); ListUtils.DataUserLoginList.Add(user); var dbDatabase = new SqLiteDatabase(); dbDatabase.InsertOrUpdateLogin_Credentials(user); dbDatabase.Dispose(); PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => ApiRequest.Get_MyProfileData_Api(this) }); } catch (Exception e) { Console.WriteLine(e); } }