private bool UpdateBook(CalilCheckResult item) { bool bUpdate = false; foreach (ViewModel.SearchResultBook book in this.BookResultList) { if (book.ISBN == item.Isbn) { bUpdate = true; string systemName; int totalLibraryCount; { CheckTargetLibrarys lib = new CheckTargetLibrarys(); systemName = lib.GetSystemName(item.SystemId); totalLibraryCount = lib.Librarys.Count(); } book.Update(item, systemName, totalLibraryCount); if (item.Status == CheckState.Running) { this.UpdateStatus("「" + book.Title + "」の蔵書検索中"); System.Diagnostics.Debug.WriteLine(this.Status); } break; } } return(bUpdate); }
public void Update(CalilCheckResult item, string systemName, int libraryTotalCount) { //図書館ごとの蔵書状況をメンバに追加する CalilStatus status = new CalilStatus(); status.SystemId = item.SystemId; status.SystemName = systemName; if (item.ReserveUrl != null) { status.ReserveUrl = item.ReserveUrl.ToString(); } status.Libkeys = item.Libkeys; status.CheckStatus = ConvertStatus(item.Status); UpdateCalilStatusList(status); if (CalilStatusList.Count() == libraryTotalCount) { SearchStatus = CheckStatus.OK; } else { SearchStatus = CheckStatus.Running; } PropertyChanged(this, new PropertyChangedEventArgs("SearchStatus")); PropertyChanged(this, new PropertyChangedEventArgs("CalilStatus")); PropertyChanged(this, new PropertyChangedEventArgs("SearchBookStatus")); PropertyChanged(this, new PropertyChangedEventArgs("SearchBookStatusColor")); }