예제 #1
0
        private void InitBinding(string id)
        {
            MainWindow.Person oFoundPerson = MainWindow.m_oPersonList.Find(oElement => oElement.StudentId == Convert.ToInt32(id));
            imie.Text     = oFoundPerson.FirstName;
            nazwisko.Text = oFoundPerson.LastName;
            wiek.Text     = Convert.ToString(oFoundPerson.Age);
            Pesel.Text    = Convert.ToString(oFoundPerson.Pesel);
            Uri image = new Uri(oFoundPerson.obraz);

            Picture.Source = new BitmapImage(image);
            idP            = id;
        }
예제 #2
0
        private void Button_Click3(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Image Filses(*.jpg; *.jpeg; *.gif; .bmp;)|.jpg; *.jpeg; *.gif; *.bmp; *.png;";

            if (openFileDialog.ShowDialog() == true)
            {
                sciezka = openFileDialog.FileName;
                Uri fileUri = new Uri(openFileDialog.FileName);
                Picture.Source = new BitmapImage(fileUri);
            }
            MainWindow.Person oFoundPerson = MainWindow.m_oPersonList.Find(oElement => oElement.StudentId == Convert.ToInt32(idP));
            oFoundPerson.obraz = Convert.ToString(Picture.Source);
        }
예제 #3
0
 private void Button_Click2(object sender, RoutedEventArgs e)
 {
     if (imie.Text == "" || nazwisko.Text == "" || wiek.Text == "" || Pesel.Text == "")
     {
         MessageBox.Show("Wprowadz wszystkie dane");
     }
     else
     {
         MainWindow.Person oFoundPerson = MainWindow.m_oPersonList.Find(oElement => oElement.StudentId == Convert.ToInt32(idP));
         oFoundPerson.FirstName = imie.Text;
         oFoundPerson.LastName  = nazwisko.Text;
         oFoundPerson.Age       = Convert.ToInt32(wiek.Text);
         oFoundPerson.Pesel     = Convert.ToInt64(Pesel.Text);
         MessageBox.Show("Edytowano dane");
     }
 }