Skip to content

Instantly share code, notes, and snippets.

@clausjoergensen
Created November 10, 2011 14:12
Show Gist options
  • Save clausjoergensen/1354938 to your computer and use it in GitHub Desktop.
Save clausjoergensen/1354938 to your computer and use it in GitHub Desktop.
public override void Execute(object parameter)
{
var oldViewItem = meterTestViewModel.SelectedTestPointSequence;
if (oldViewItem == null)
{
return;
}
var testPointSequenceCopy = oldViewItem.Save();
var config = oldViewItem.TestPoint.TestPointConfiguration;
var newViewItem = new TestPointSequenceViewItem
(
new TestPointSequence()
{
AcceptanceTestRevision = oldViewItem.AcceptanceTestRevision,
Number = meterTestViewModel.SelectedAcceptanceTestRevision.TestPointSequences.Count,
TestPoint = new TestPoint()
{
Name = "Kopi af " + oldViewItem.TestPoint.Name,
Created = DateTime.Now,
CreatedBy = UserSession.Instance.UserName,
TestPointConfiguration = oldViewItem.TestPointConfiguration.Save()
}
}
);
var viewModel = new TestPointDialogViewModel(newViewItem, testPointRepository);
var result = dialogService.ShowDialog<TestPointDialog>(viewModel);
if (result == true)
{
var testPointSequence = newViewItem.Save();
testPointRepository.Add(testPointSequence);
testPointRepository.SaveChanges();
// TODO: Update View
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment