using PP_Ven_MosS.Classes; using PP_Ven_MosS.ModelBase; using System.Linq; using System.Windows; using System.Windows.Controls; namespace PP_Ven_MosS.Pages { /// /// Логика взаимодействия для ReportForEvent.xaml /// public partial class ReportForEvent : Page { public Event Eventedit = null; public ReportForEvent(Event Mer) { InitializeComponent(); Eventedit = Mer; txtTitleEv.Text = Mer.Title_event; txtDesc.Text = Mer.Description_event; txtDate.Text = Mer.Date_event.ToString(); Place_event pev = Classes.Database.entities.Place_event.FirstOrDefault(x => x.id_event == Mer.Id_event); if (pev != null) { Place pl = Classes.Database.entities.Place.FirstOrDefault(x => x.id_place == pev.id_place); txtPlace.Text = pl.title_place; } } private void Exit_Click(object sender, RoutedEventArgs e) { FrameClass.MainFrame.Navigate(new MenuAdmin()); } private void Save_Click(object sender, RoutedEventArgs e) { if (Eventedit != null) { Event evnt = Classes.Database.entities.Event.FirstOrDefault(x => x.Id_event == Eventedit.Id_event); evnt.media = txtURL.Text; Classes.Database.entities.SaveChanges(); MessageBox.Show("Отчет успешно сохранен", "Уведомление", MessageBoxButton.OK, MessageBoxImage.Information); } } } }