private void PoleZapisz(object sender, RoutedEventArgs e) { try { webtoon NowyKomiks = new webtoon(); author NowyAutor = new author(); NowyKomiks.title = PoleTytul.Text; NowyAutor.name = PoleName.Text; NowyAutor.surname = PoleSurname.Text; for_publishers nowy_zag_wyd = new for_publishers(); orig_publishers nowy_oryg_wyd = new orig_publishers(); nowy_oryg_wyd.name = PoleOrWyd.Text; nowy_zag_wyd.name = PoleZagWyd.Text; var cultureInfo = new CultureInfo("pl-PL"); string dateString = PoleDataPub.Text; NowyKomiks.date_of_publication = DateTime.Parse(dateString, cultureInfo); DB.webtoons.Add(NowyKomiks); DB.SaveChanges(); this.Close(); } catch { MessageBox.Show("Błędne dane, wpisz poprawne"); } }
public AddComic(webtoon Komiks, db_WebtoonsEntities DB) { this.Komiks = Komiks; this.DB = DB; InitializeComponent(); }