Esempio n. 1
0
        public void UnwindToLogIn(UIStoryboardSegue segue)
        {
            //Textfields are initialized blank
            usernameTxtF.Text = "";
            passwordTxtF.Text = "";

            if (segue.Identifier.Equals("signupToLogin"))
            {
                var signup = (SignUpViewController)segue.SourceViewController;
                //deserialize
                signup.saveInfo();
                //IMPLEMENTATION: send json to database
                //TESTING: adds user to userData
                userAccount tempUser = JsonConvert.DeserializeObject <userAccount>(signup.json);
                userData.Add(tempUser);
            }
        }
        public void saveInfo()
        {
            //doneButton creates a new account
            var newUser = new userAccount
            {
                firstName  = firstTxtF.Text,
                middleName = midTxtF.Text,
                lastName   = lastTxtF.Text,
                email      = emailTxtF.Text,
                pass       = passwordTxtF.Text,
                cpass      = confirmPassTxtF.Text,
                num        = phoneNumTxtF.Text,
                ssn        = ssnTxtF.Text,
                dob        = dob
            };

            json = JsonConvert.SerializeObject(newUser);
        }