private void UpdateButton_Click(object sender, RoutedEventArgs e) { if (ValidateAll() && eventId != 0) { EventDBContext.IntitalizeDB(); EventDBContext.Update(eventId, EventDate.Text.ToString(), EventAdress.Text.ToString(), EventDetail.Text.ToString().Trim()); InitializeDataGrid(); ClearAll(); WindowSuccess success = new WindowSuccess(); success.SetContent("Event Updated Succefully"); success.Show(); } else { WindowError error = new WindowError(); error.SetContent("Event Is Not Selected"); error.Show(); } }