public async Task UpdateProfile(string bio, string age, string location, string name)
        {
            int  n;
            bool isInt = int.TryParse(age, out n);

            if (isInt)
            {
                //VALID INT, PROCESS UPDATE
                var guids = await Models.Persistence.UsersCredentials.GetAllUsers(_connection);

                var guid = guids[0];

                Models.Persistence.Profile profile = new Models.Persistence.Profile()
                {
                    Bio      = bio,
                    Age      = n,
                    Location = location,
                    Name     = name,
                    UserGuid = guid.UserGuid
                };


                bool completedUpdateOfProfile = await Models.Persistence.Profile.UpdateProfile(_connection, profile);

                if (!completedUpdateOfProfile)
                {
                    //HASNT WORKED FOR SOME REASON, ERROR OUT TO USER.
                }
            }
            else
            {
                //ERROR SOMEHOW
            }
        }
 public EditProfilePage(Models.Persistence.Profile profile)
 {
     EditProfileRecord = profile;
     InitializeComponent();
     _connection = DependencyService.Get <ISQLiteDb>().GetConnection();
     textChanged = false;
 }
Exemplo n.º 3
0
        public ProfilePage()
        {
            InitializeComponent();
            _connection = DependencyService.Get <ISQLiteDb>().GetConnection();

            p = new Models.Persistence.Profile();

            //NAVBAR EDITS
            var navPage = Application.Current.MainPage as NavigationPage;

            navPage.BarBackgroundColor             = Color.FromHex("#06a4cc");
            navPage.BarTextColor                   = Color.White;
            UINavigationBar.Appearance.ShadowImage = new UIImage();
        }