Exemple #1
0
 public void UpdataFromFriend(Friend f)
 {
     user_id = f.user_id;
     if (f.ip != null)
     {
         ip = f.ip.GetAddressBytes();
     }
     else
     {
         ip = null;
     }
     nickname = f.nickname;
     name     = f.name;
     if (ext == null)
     {
         ext            = new UserExt();
         ext.Age        = f.Age;
         ext.Country    = f.Country;
         ext.GroupSet   = f.GroupSet;
         ext.Hometown   = f.Hometown;
         ext.Introduce  = f.Introduce;
         ext.Level      = f.Level;
         ext.Motto      = f.Motto;
         ext.Telephone  = f.Telephone;
         ext.User_Image = UserExt.ImageToBase64(f.User_Image as BitmapImage);
     }
 }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            UserExt userext = new UserExt();

            int.TryParse(age.Text, out userext.Age);
            userext.User_Image = UserExt.ImageToBase64(head.Source as BitmapImage);
            userext.Country    = country.Text;
            userext.Hometown   = hometown.Text;
            userext.Motto      = motto.Text;
            userext.Introduce  = introduce.Text;
            User user = Register.user;

            user.ext = userext;
            ServerAPI.UpdataMyInfo(user);

            LoginPage loginpage = new LoginPage();

            loginpage.Username.Text = Register.user.name;
            NavigationService.Navigate(loginpage);
        }
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            UserExt userext = new UserExt();

            int.TryParse(age.Text, out userext.Age);
            userext.User_Image = UserExt.ImageToBase64(head.Source as BitmapImage);
            userext.Country    = country.Text;
            userext.Hometown   = hometown.Text;
            userext.Motto      = motto.Text;
            userext.Introduce  = introduce.Text;
            User user = App.data.Me.toUser();

            user.ext = userext;
            if (ServerAPI.UpdataMyInfo(user))
            {
                App.data.Me.User_Image = head.Source;

                UserWindow.isNeedUpdate = true;
            }
        }