void Initialize() { JournalRecords = new ObservableCollection<JournalRecordViewModel>(); //if (FiresecManager.IsFS2Enabled) //{ // var operationResult = FiresecManager.FS2ClientContract.GetFilteredJournal(JournalFilter); // if (operationResult.Result != null) // { // foreach (var journalItem in operationResult.Result) // { // var journalRecordViewModel = new JournalRecordViewModel(journalItem); // JournalRecords.Add(journalRecordViewModel); // } // } //} //else { var operationResult = FiresecManager.FiresecService.GetFilteredJournal(JournalFilter); if (operationResult.Result != null) { foreach (var journalRecord in operationResult.Result) { JournalConverter.SetDeviceCatogoryAndDevieUID(journalRecord); var journalRecordViewModel = new JournalRecordViewModel(journalRecord); JournalRecords.Add(journalRecordViewModel); } } } SelectedRecord = JournalRecords.FirstOrDefault(); }
//public ArchivePageViewModel(IEnumerable<FS2JournalItem> journalItems) //{ // JournalItemsList = journalItems; //} public void Create() { JournalRecords = new List<JournalRecordViewModel>(); if (JournalRecordsList != null) { foreach (var journalRecord in JournalRecordsList) { var journalRecordViewModel = new JournalRecordViewModel(journalRecord); JournalRecords.Add(journalRecordViewModel); } } //if (JournalItemsList != null) //{ // foreach (var journalItem in JournalItemsList) // { // var journalRecordViewModel = new JournalRecordViewModel(journalItem); // JournalRecords.Add(journalRecordViewModel); // } //} }
void Initialize() { var operationResult = FiresecManager.FiresecService.GetFilteredJournal(JournalFilter); JournalRecords = new ObservableCollection<JournalRecordViewModel>(); if (operationResult.HasError == false) { foreach (var journalRecord in operationResult.Result) { var journalRecordViewModel = new JournalRecordViewModel(journalRecord); JournalRecords.Add(journalRecordViewModel); } } SelectedRecord = JournalRecords.FirstOrDefault(); }
public ConfirmationViewModel(JournalRecord journalRecord) { Title = "Подтверждение критических событий"; ConfirmCommand = new RelayCommand(OnConfirm); JournalRecord = new JournalRecordViewModel(journalRecord); }