private void ExecuteDeleteNC(object parameter) { NCI DeleteNCI = (NCI)parameter; context.NCIs.Remove(DeleteNCI); context.SaveChanges(); NotifyPropertyChanged("CanRemoveTermineFilter"); itemCollectionViewSource.Source = context.NCIs.ToList(); }
private void ExecuteUpdateNC(object parameter) { NCI UpdateNCI = (NCI)parameter; //int Id = DeleteNCI.Id; PageU = new PageModifierMVVM(UpdateNCI); //PageU.DataContext = UpdateNCI; PageU.DataContext = this; //PageU.DataContext = context; PageU.ShowDialog(); }
private void btnModifier_Click(object sender, RoutedEventArgs e) { NCI UpdateNCI = (from n in context.NCIs where n.Id == Id select n).Single(); UpdateNCI.Zone = comboboxzone.Text; UpdateNCI.TitreNCI = textblockTitreNCI.Text; UpdateNCI.CommentNCI = textblockCommentNCI.Text; UpdateNCI.ActionNCI = textblockActionNCI.Text; context.SaveChanges(); //MainWindow.datagrid.ItemsSource = context.NCIs.ToList(); this.Hide(); }
public PageModifier(int memberId) { InitializeComponent(); Id = memberId; NCI UpdateNCI = (from n in context.NCIs where n.Id == Id select n).Single(); comboboxzone.Text = UpdateNCI.Zone; textblockTitreNCI.Text = UpdateNCI.TitreNCI; textblockCommentNCI.Text = UpdateNCI.CommentNCI; textblockActionNCI.Text = UpdateNCI.ActionNCI; textblockCreele.Text = UpdateNCI.DateCreaNCI.ToString(); textblockCreepar.Text = UpdateNCI.CreateurNCI; }
//int Id; //LOG_NCEntities context = new LOG_NCEntities(); public PageModifierMVVM(NCI UpdateNCI) { InitializeComponent(); }