示例#1
0
        public Profile()
        {
            InitializeComponent();
            DataContext = this;
            UserProfile  userProfile = new UserProfile();
            JObject      json        = SetProfile(userProfile);
            UserRegister result      = json.ToObject <UserRegister>(new Newtonsoft.Json.JsonSerializer());

            if (result == null)
            {
                string exception = json.ToObject <string>(new Newtonsoft.Json.JsonSerializer());
            }
            else
            {
                this.UserName              = result.Name;
                this.Name.Text             = UserName;
                this.UserSurname           = result.Surname;
                this.Surname.Text          = UserSurname;
                this.UserEmail             = result.Email;
                this.Email.Text            = UserEmail;
                this.UserProfilePhoto      = result.ProfilePhoto;
                this.ProfilePhoto.Text     = UserProfilePhoto;
                this.BornDate.SelectedDate = UserBornDate;
                this.UserCountry           = result.Country;
                this.Country.Text          = UserCountry;
            }
            this.DataContext = new WindowViewModel(this);
        }
示例#2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            UserEdit     userEdit = new UserEdit(UserName, UserSurname, UserEmail, UserProfilePhoto, UserBornDate, UserCountry);
            JObject      json     = UserEdit(userEdit);
            UserRegister result   = json.ToObject <UserRegister>(new Newtonsoft.Json.JsonSerializer());

            if (result == null)
            {
                string exception = json.ToObject <string>(new Newtonsoft.Json.JsonSerializer());
            }
            else
            {
            }
        }
示例#3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            UserRegister   ur     = new UserRegister(UserName, UserSurname, UserEmail, UserProfilePhoto, UserBornDate, UserCountry);
            JObject        json   = callSync(ur);
            RegisterResult result = json.ToObject <RegisterResult>(new Newtonsoft.Json.JsonSerializer());

            if (String.IsNullOrEmpty(result.TokenString))
            {
                string exception = json.ToObject <string>(new Newtonsoft.Json.JsonSerializer());
            }
            else
            {
                RunTimeVariables.TokenString = result.TokenString;
                RunTimeVariables.IdUser      = result.IdUser;
            }
            SetPassword password = new SetPassword();

            password.Show();
            Close();
        }
示例#4
0
        public JObject callSync(UserRegister ur)
        {
            JObject result = URL.AppendPathSegment("user/create").PostJsonAsync(ur).ReceiveJson <JObject>().Result;

            return(result);
        }