Created
November 10, 2011 14:12
-
-
Save clausjoergensen/1354938 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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