void update_RecodeStatus(SearchLogItem logItem0, bool isUpdateDB0, SqlCommand cmd0) { List <EpgEventInfo> epgList1 = new List <EpgEventInfo>(); foreach (var item in logItem0.resultItems) { epgList1.Add(item.epgEventInfoR); } List <RecLogItem> recLogItems1 = _db_RecLog.exists(epgList1, cmd0); List <SearchLogResultItem> results_Updated1 = new List <SearchLogResultItem>(); foreach (var item in logItem0.resultItems) { RecLogItem.RecodeStatuses recodeStatus1 = RecLogItem.RecodeStatuses.NONE; RecLogItem recLogItem1 = recLogItems1.Find(x => x.epgEventInfoR.Equals(item.epgEventInfoR)); if (recLogItem1 != null) { recodeStatus1 = recLogItem1.recodeStatus; } if (item.recodeStatus != recodeStatus1) { item.recodeStatus = recodeStatus1; results_Updated1.Add(item); } } if (isUpdateDB0) { _db_SearchLogResult.update(results_Updated1, cmd0); } }
public void showResult(EpgEventInfo epgEventInfo0) { reset(); if (Settings.Instance.RecLog_SearchLog_IsEnabled) { _epgEventInfo = epgEventInfo0; _selectedRecLogItem = _mainWindow.recLogView.db_RecLog.exists(RecLogItem.RecodeStatuses.ALL, epgEventInfo0.original_network_id, epgEventInfo0.transport_stream_id, epgEventInfo0.service_id, epgEventInfo0.event_id, epgEventInfo0.start_time); if (_selectedRecLogItem != null) { switch (_selectedRecLogItem.recodeStatus) { case RecLogItem.RecodeStatuses.録画完了: menuItem_ChangeStatus_NONE.IsEnabled = true; menuItem_ChangeStatus_Recorded.IsEnabled = false; break; default: menuItem_ChangeStatus_NONE.IsEnabled = false; menuItem_ChangeStatus_Recorded.IsEnabled = true; break; } } search(epgEventInfo0.ShortInfo.event_name, _selectedRecLogItem, epgEventInfo0.ContentInfo); } else { drawText(RecLogView.notEnabledMessage); } show(); }
public void showResult(RecFileInfo recFileInfo0) { reset(); if (Settings.Instance.RecLog_SearchLog_IsEnabled) { _recFileInfo = recFileInfo0; _selectedRecLogItem = _mainWindow.recLogView.db_RecLog.exists(recFileInfo0); if (_selectedRecLogItem != null) { switch (_selectedRecLogItem.recodeStatus) { case RecLogItem.RecodeStatuses.録画完了: menuItem_ChangeStatus_NONE.IsEnabled = true; menuItem_ChangeStatus_Recorded.IsEnabled = false; break; default: menuItem_ChangeStatus_NONE.IsEnabled = false; menuItem_ChangeStatus_Recorded.IsEnabled = true; break; } } search(recFileInfo0.Title, _selectedRecLogItem); } else { drawText(RecLogView.notEnabledMessage); } show(); }
public void showResult(ReserveData reserveData0) { reset(); if (Settings.Instance.RecLog_SearchLog_IsEnabled) { _selectedRecLogItem = _mainWindow.recLogView.db_RecLog.exists(RecLogItem.RecodeStatuses.ALL, reserveData0.OriginalNetworkID, reserveData0.TransportStreamID, reserveData0.ServiceID, reserveData0.EventID, reserveData0.StartTime); if (_selectedRecLogItem != null) { switch (_selectedRecLogItem.recodeStatus) { case RecLogItem.RecodeStatuses.録画完了: menuItem_ChangeStatus_NONE.IsEnabled = true; menuItem_ChangeStatus_Recorded.IsEnabled = false; break; default: menuItem_ChangeStatus_NONE.IsEnabled = false; menuItem_ChangeStatus_Recorded.IsEnabled = true; break; } } search(reserveData0.Title, _selectedRecLogItem); } else { drawText(RecLogView.notEnabledMessage); } show(); }
void reset() { menuItem_ChangeStatus_Recorded.IsEnabled = true; richTextBox_SelectedItem.Visibility = Visibility.Visible; _resultList.Clear(); _epgEventInfo = null; _recFileInfo = null; _selectedRecLogItem = null; richTextBox.Document.Blocks.Clear(); }
/// <summary> /// 検索結果の録画ステータスを変更、または録画ログを新たに追加する。 /// </summary> /// <param name="searchLogResultItems"></param> public void update_RecodeStatus(IEnumerable <SearchLogResultItem> searchLogResultItems) { DateTime lastUpdate1 = DateTime.Now; try { using (SqlConnection sqlConn1 = new SqlConnection(sqlConnStr)) { sqlConn1.Open(); using (SqlCommand cmd1 = sqlConn1.CreateCommand()) { List <RecLogItem> recLogItems_Insert1 = new List <RecLogItem>(); List <RecLogItem> recLogItems_Update1 = new List <RecLogItem>(); List <RecLogItem> recLogItems_Delete1 = new List <RecLogItem>(); foreach (var item in searchLogResultItems) { RecLogItem recLogItem1 = _db_RecLog.exists(item.epgEventInfoR, cmd1); if (recLogItem1 == null) { if (item.recodeStatus != RecLogItem.RecodeStatuses.NONE) { recLogItem1 = new RecLogItem() { lastUpdate = lastUpdate1, recodeStatus = item.recodeStatus, epgEventInfoR = item.epgEventInfoR }; recLogItems_Insert1.Add(recLogItem1); } } else if (item.recodeStatus == RecLogItem.RecodeStatuses.NONE) { recLogItems_Delete1.Add(recLogItem1); } else { recLogItem1.lastUpdate = lastUpdate1; recLogItem1.recodeStatus = item.recodeStatus; recLogItems_Update1.Add(recLogItem1); } } _db_RecLog.insert(recLogItems_Insert1, cmd1); _db_RecLog.update(recLogItems_Update1, cmd1); _db_RecLog.delete(recLogItems_Delete1, cmd1); } } } catch (Exception ex0) { errLog(ex0); } }
void menuItem_ChangeStatus_Recorded_Click(object sender, RoutedEventArgs e) { DateTime lastUpdate1 = DateTime.Now; RecLogItem recLogItem1 = null; if (_epgEventInfo != null) { recLogItem1 = db_RecLog.exists(_epgEventInfo); if (recLogItem1 == null) { recLogItem1 = new RecLogItem() { lastUpdate = lastUpdate1, recodeStatus = RecLogItem.RecodeStatuses.録画完了, epgEventInfoR = new EpgEventInfoR(_epgEventInfo, lastUpdate1) }; db_RecLog.insert(recLogItem1); } else { recLogItem1.recodeStatus = RecLogItem.RecodeStatuses.録画完了; db_RecLog.update(recLogItem1); } } else if (_recFileInfo != null) { recLogItem1 = db_RecLog.exists(_recFileInfo); if (recLogItem1 == null) { recLogItem1 = db_RecLog.insert(_recFileInfo, lastUpdate1); } else { recLogItem1.recodeStatus = RecLogItem.RecodeStatuses.録画完了; db_RecLog.update(recLogItem1); } } if (recLogItem1 != null) { string line1 = "[録]" + "[’" + recLogItem1.epgEventInfoR.start_time.ToString("yy/MM/dd") + "] " + recLogItem1.epgEventInfoR.ShortInfo.event_name; drawText(richTextBox_SelectedItem, new List <string>() { line1 }, _background_Selected); menuItem_ChangeStatus_NONE.IsEnabled = true; menuItem_ChangeStatus_Recorded.IsEnabled = false; } }
void search(string searchWord0, RecLogItem selectedRecLogItem = null, EpgContentInfo epgContentInfo0 = null) { string selectedItem1 = null; string searchWord1 = trimKeyword(searchWord0); _resultList = _mainWindow.recLogView.getRecLogList(searchWord1, Settings.Instance.RecLogWindow_SearchResultLimit, epgContentInfo0: epgContentInfo0); List <string> lines1 = new List <string>(); if (0 < _resultList.Count) { foreach (RecLogItem item in _resultList) { string line1 = "[" + item.recodeStatus_Abbr + "]" + "[’" + item.epgEventInfoR.start_time.ToString("yy/MM/dd") + "] " + item.epgEventInfoR.ShortInfo.event_name; if (selectedRecLogItem != null && selectedRecLogItem.ID == item.ID) { selectedItem1 = line1; } else { lines1.Add(line1); } } } else { lines1.Add("(NOT FOUND)"); } // //if (string.IsNullOrEmpty(selectedItem1)) //{ // richTextBox_SelectedItem.Visibility = Visibility.Collapsed; //} //else { richTextBox_SelectedItem.Visibility = Visibility.Visible; drawText(richTextBox_SelectedItem, new List <string>() { selectedItem1 }, _background_Selected); } textBox.Text = searchWord1; drawText(lines1); }
void changeRecordStatus(RecLogItem.RecodeStatuses status0) { List<RecLogItem> list1 = new List<RecLogItem>(); foreach (RecLogItem item in listView_RecLog.SelectedItems) { item.recodeStatus = status0; list1.Add(item); } db_RecLog.update(list1); }
void search(string searchWord0, RecLogItem selectedRecLogItem = null, EpgContentInfo epgContentInfo0 = null) { string selectedItem1 = null; string searchWord1 = trimKeyword(searchWord0); _resultList = _mainWindow.recLogView.getRecLogList(searchWord1, Settings.Instance.RecLogWindow_SearchResultLimit, epgContentInfo0: epgContentInfo0); List<string> lines1 = new List<string>(); if (0 < _resultList.Count) { foreach (RecLogItem item in _resultList) { string line1 = "[" + item.recodeStatus_Abbr + "]" + "[’" + item.epgEventInfoR.start_time.ToString("yy/MM/dd") + "] " + item.epgEventInfoR.ShortInfo.event_name; if (selectedRecLogItem != null && selectedRecLogItem.ID == item.ID) { selectedItem1 = line1; } else { lines1.Add(line1); } } } else { lines1.Add("(NOT FOUND)"); } // //if (string.IsNullOrEmpty(selectedItem1)) //{ // richTextBox_SelectedItem.Visibility = Visibility.Collapsed; //} //else { richTextBox_SelectedItem.Visibility = Visibility.Visible; drawText(richTextBox_SelectedItem, new List<string>() { selectedItem1 }, _background_Selected); } textBox.Text = searchWord1; drawText(lines1); }
void menuItem_ChangeStatus_Recorded_Click(object sender, RoutedEventArgs e) { DateTime lastUpdate1 = DateTime.Now; RecLogItem recLogItem1 = null; if (_epgEventInfo != null) { recLogItem1 = new RecLogItem() { lastUpdate = lastUpdate1, recodeStatus = RecLogItem.RecodeStatuses.録画完了, epgEventInfoR = new EpgEventInfoR(_epgEventInfo, lastUpdate1) }; db_RecLog.insert(recLogItem1); } else if (_recFileInfo != null) { recLogItem1 = db_RecLog.exists(_recFileInfo); if (recLogItem1 == null) { recLogItem1 = db_RecLog.insert(_recFileInfo, lastUpdate1); } else { recLogItem1.recodeStatus = RecLogItem.RecodeStatuses.録画完了; db_RecLog.update(recLogItem1); } } if (recLogItem1 != null) { string line1 = "[録]" + "[’" + recLogItem1.epgEventInfoR.start_time.ToString("yy/MM/dd") + "] " + recLogItem1.epgEventInfoR.ShortInfo.event_name; drawText(richTextBox_SelectedItem, new List<string>() { line1 }, _background_Selected); menuItem_ChangeStatus_NONE.IsEnabled = true; menuItem_ChangeStatus_Recorded.IsEnabled = false; } }
public void showResult(RecFileInfo recFileInfo0) { reset(); if (Settings.Instance.RecLog_SearchLog_IsEnabled) { _recFileInfo = recFileInfo0; _selectedRecLogItem = _mainWindow.recLogView.db_RecLog.exists(recFileInfo0); if (_selectedRecLogItem != null ) { switch (_selectedRecLogItem.recodeStatus) { case RecLogItem.RecodeStatuses.録画完了: menuItem_ChangeStatus_NONE.IsEnabled = true; menuItem_ChangeStatus_Recorded.IsEnabled = false; break; default: menuItem_ChangeStatus_NONE.IsEnabled = false; menuItem_ChangeStatus_Recorded.IsEnabled = true; break; } } search(recFileInfo0.Title, _selectedRecLogItem); } else { drawText(RecLogView.notEnabledMessage); } show(); }
void clearEditor() { _recLogItem_Edit = null; // textBox_Edit_ProgramTitle.Clear(); label_Editor_Date.Content = null; label_Editor_ServiceName.Content = null; comboBox_Edit_Status.SelectedItem = null; checkBox_AllowOverWrite.IsChecked = false; textBox_RecFilePath.Clear(); richTextBox_Comment.Document.Blocks.Clear(); richTextBox_ShortInfo_text_char.Document.Blocks.Clear(); richTextBox_ExtInfo_text_char.Document.Blocks.Clear(); // textBox_Edit_ProgramTitle.BorderThickness = new Thickness(0); textBox_RecFilePath.BorderThickness = new Thickness(0); border_RecStatus.BorderThickness = new Thickness(0); border_AllowOverWrite.BorderThickness = new Thickness(0); richTextBox_Comment.BorderThickness = new Thickness(0); richTextBox_ShortInfo_text_char.BorderThickness = new Thickness(0); richTextBox_ExtInfo_text_char.BorderThickness = new Thickness(0); }
public List<RecLogItem> getRecLogList(string searchWord0, int resultLimit0, RecLogItem.RecodeStatuses recodeStatuse0 = RecLogItem.RecodeStatuses.ALL, DB_RecLog.searchColumns searchColumns0 = DB_RecLog.searchColumns.title, EpgContentInfo epgContentInfo0 = null) { List<RecLogItem> recLogItemList1; switch (searchMethod) { case searchMethods.LIKE: recLogItemList1 = db_RecLog.search_Like(searchWord0, recodeStatuse0, searchColumns0, resultLimit0, epgContentInfo0); break; case searchMethods.Contrains: recLogItemList1 = db_RecLog.search_Fulltext(searchWord0, recodeStatuse0, searchColumns0, resultLimit0, epgContentInfo0); break; case searchMethods.Freetext: recLogItemList1 = db_RecLog.search_Fulltext(searchWord0, recodeStatuse0, searchColumns0, resultLimit0, epgContentInfo0, true); break; default: throw new NotSupportedException(); } return recLogItemList1; }
void updateReserveInfo() { DateTime lastUpdate1 = DateTime.Now; // int reservedCount_New1 = 0; int reservedCount_Update1 = 0; foreach (ReserveData rd1 in CommonManager.Instance.DB.ReserveList.Values) { EpgEventInfo epgEventInfo1 = getEpgEventInfo(rd1.OriginalNetworkID, rd1.TransportStreamID, rd1.ServiceID, rd1.EventID); if (epgEventInfo1 == null) { // EPGデータが見つからない // 1.EpgEventInfo.eventIDが変更された // 2.放送が中止になった // 3.EPGデータ更新中 continue; // 無視する //epgEventInfo1 = new EpgEventInfo(); } EpgEventInfoR epgEventInfoR1 = new EpgEventInfoR(epgEventInfo1, lastUpdate1); RecLogItem recLogItem1 = db_RecLog.exists(rd1); if (recLogItem1 == null) { // 新規登録 reservedCount_New1++; RecLogItem recLogItem2 = new RecLogItem() { lastUpdate = lastUpdate1, epgEventInfoR = epgEventInfoR1 }; if (rd1.RecSetting.RecMode == 0x05) // 録画モード:無効 { recLogItem2.recodeStatus = RecLogItem.RecodeStatuses.無効登録; } else { recLogItem2.recodeStatus = RecLogItem.RecodeStatuses.予約済み; } db_RecLog.insert(recLogItem2); } else { //更新 reservedCount_Update1++; recLogItem1.lastUpdate = lastUpdate1; if (rd1.RecSetting.RecMode == 0x05) // 録画モード:無効 { if (recLogItem1.recodeStatus != RecLogItem.RecodeStatuses.無効登録) { recLogItem1.recodeStatus = RecLogItem.RecodeStatuses.無効登録; reservedCount_New1++; } } else { if (recLogItem1.recodeStatus != RecLogItem.RecodeStatuses.予約済み) { recLogItem1.recodeStatus = RecLogItem.RecodeStatuses.予約済み; reservedCount_New1++; } } db_RecLog.update(recLogItem1); } } // // 予約削除 - 更新されなかったものを対象とする // List<RecLogItem> list_NotUpdated1 = db_RecLog.select_Reserved_NotUpdated(lastUpdate1); List<RecLogItem> list_Deleted1 = new List<RecLogItem>(); List<RecLogItem> list_RecstatusUpdateErr1 = new List<RecLogItem>(); foreach (RecLogItem item1 in list_NotUpdated1) { if (item1.epgEventInfoR != null && lastUpdate1 < item1.epgEventInfoR.start_time) { // 未来に放送 list_Deleted1.Add(item1); } else if (item1.recodeStatus == RecLogItem.RecodeStatuses.無効登録) { // 無効登録を削除 list_Deleted1.Add(item1); } else { // 録画完了? list_RecstatusUpdateErr1.Add(item1); } } // if (0 < list_RecstatusUpdateErr1.Count) { addDBLog("ステータス更新失敗:" + list_RecstatusUpdateErr1.Count); foreach (RecLogItem logItem1 in list_RecstatusUpdateErr1) { RecFileInfo rfi1 = null; foreach (RecFileInfo rfi2 in CommonManager.Instance.DB.RecFileInfo.Values) { if (logItem1.equals(rfi2)) { rfi1 = rfi2; break; } } if (rfi1 != null) { if ((RecEndStatus)rfi1.RecStatus == RecEndStatus.NORMAL) { logItem1.recodeStatus = RecLogItem.RecodeStatuses.録画完了; } else { logItem1.recodeStatus = RecLogItem.RecodeStatuses.録画異常; } } else { logItem1.recodeStatus = RecLogItem.RecodeStatuses.不明; } logItem1.lastUpdate = lastUpdate1; db_RecLog.update(logItem1); } } // int reservedCount_Removed1 = db_RecLog.delete(list_Deleted1.ToArray()); // addDBLog("予約更新(+" + reservedCount_New1 + ",-" + reservedCount_Removed1 + ") " + lastUpdate1.ToString(_timestampFormat)); // if (0 < reservedCount_New1 || 0 < reservedCount_Removed1) { _isReserveInfoChanged = true; } }
void setRecLogItem2editor() { RecLogItem recLogItem_Edit1 = listView_RecLog.SelectedItem as RecLogItem; if (recLogItem_Edit1 == null) { return; } // clearEditor(); grid_Edit.Visibility = Visibility.Visible; // textBox_Edit_ProgramTitle.Text = recLogItem_Edit1.epgEventInfoR.ShortInfo.event_name; label_Editor_Date.Content = CommonManager.ConvertTimeText( recLogItem_Edit1.epgEventInfoR.start_time, recLogItem_Edit1.epgEventInfoR.durationSec, false, false, true); label_Editor_ServiceName.Content = recLogItem_Edit1.tvStationName + " (" + CommonManager.ConvertNetworkNameText(recLogItem_Edit1.epgEventInfoR.original_network_id) + ")"; comboBox_Edit_Status.SelectedItem = recLogItem_Edit1.recodeStatus; checkBox_AllowOverWrite.IsChecked = recLogItem_Edit1.epgAlllowOverWrite; textBox_RecFilePath.Text = recLogItem_Edit1.recFilePath; setText(richTextBox_Comment, recLogItem_Edit1.comment); setText(richTextBox_ShortInfo_text_char, recLogItem_Edit1.epgEventInfoR.ShortInfo.text_char); setText(richTextBox_ExtInfo_text_char, recLogItem_Edit1.epgEventInfoR.ExtInfo.text_char); // _recLogItem_Edit = recLogItem_Edit1; }