private void Mentes_Click(object sender, RoutedEventArgs e) { gyKezelo.ÚjGyanúsított((GyanúsítottStátusz)Enum.Parse(typeof(GyanúsítottStátusz), statusz_cbx.SelectedItem.ToString()), lakcim_txt.Text, id, nev_txt.Text); if (filepath != null) { string name = System.IO.Path.GetFileName(filepath); string destinationPath = GetDestinationPath(id + ".jpg", "../../kepek"); try { File.Copy(filepath, destinationPath, true); } catch (IOException ee) { MessageBox.Show("Hiba történt, részletek a naplóban"); NaplozoNamespace.Service1Client kliens = new NaplozoNamespace.Service1Client(); kliens.NaplobaIras(ee.ToString()); } Uri u = new Uri(System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + "../../../kepek/" + id + ".jpg"); kep_img.Source = new BitmapImage(u); } this.DialogResult = true; }