コード例 #1
0
        public AddDefaultCostViewModel() : base()
        {
            SelectedDirectoryRC = DirectoryRCs.First(r => r.Name == "ВСЕ");

            AddEditDefaultCostCommand = new RelayCommand(Add, IsValidate);

            AddEditButtonName = "Добавить";
        }
コード例 #2
0
        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 = "Изменить";
        }