public AddDefaultCostViewModel() : base() { SelectedDirectoryRC = DirectoryRCs.First(r => r.Name == "ВСЕ"); AddEditDefaultCostCommand = new RelayCommand(Add, IsValidate); AddEditButtonName = "Добавить"; }
public EditDefaultCostViewModel(DefaultCost defaultCost) { _defaultCostId = defaultCost.Id; SelectedDirectoryCostItem = DirectoryCostItems.First(c => c.Name == defaultCost.DirectoryCostItem.Name); SelectedDirectoryRC = DirectoryRCs.First(r => r.Name == defaultCost.DirectoryRC.Name); SelectedDirectoryNote = DirectoryNotes.First(n => n.Description == defaultCost.DirectoryNote.Description); SummOfPayment = defaultCost.SummOfPayment; DayOfPayment = defaultCost.DayOfPayment; AddEditDefaultCostCommand = new RelayCommand(Edit, IsValidate); AddEditButtonName = "Изменить"; }