Ejemplo n.º 1
0
        private void LoadElements()
        {
            using (Models.OrganizerDB context = new Models.OrganizerDB())
            {
                Models.Person pers = context.Person.Find(Classes.SelectContact.SelectContactID);

                var brush = new ImageBrush();
                brush.ImageSource      = ImageFunc.ConvertImageFromBinary(pers.PersonPhoto);
                PersonPhoto.Background = brush;

                Name.Text       = pers.Name;
                LastName.Text   = pers.Lastname;
                Patronymic.Text = pers.Patronymic;

                if (pers.Gender == "М")
                {
                    Gender.SelectedIndex = 0;
                }
                else
                {
                    Gender.SelectedIndex = 1;
                }

                DOB.Text         = pers.DOB;
                NickName.Text    = pers.NickName;
                PhoneNumber.Text = pers.Phone_number;
                Position.Text    = pers.Position;
                Email.Text       = pers.Email;
                Adress.Text      = pers.AdressPerson;
            }
        }
Ejemplo n.º 2
0
 private void WindowLoaded(object sender, RoutedEventArgs e)
 {
     using (Models.OrganizerDB context = new Models.OrganizerDB())
     {
         Models.User user  = context.User.Find(Classes.SelectUser.SelectUserID);
         var         brush = new ImageBrush();
         brush.ImageSource    = ImageFunc.ConvertImageFromBinary(user.UserPhoto);
         UserPhoto.Background = brush;
         Username.Text        = user.UserName;
     }
 }