public static SearchEntityCollection GetSearchEntities() { var entities = new SearchEntityCollection(); using (var command = new SQLiteCommand()) { command.CommandText = "Select distinct [Text] From [VideoTags] Where [Deleted] = 0;"; using (var reader = accesser.ExecuteReader(command)) { if (reader.HasRows) { while (reader.Read()) { entities.Add(new SearchEntity("Tag", reader.GetString(0))); } } } } using (var command = new SQLiteCommand()) { command.CommandText = "Select distinct [Series] From [VideoRecords] Where [Deleted] = 0;"; using (var reader = accesser.ExecuteReader(command)) { if (reader.HasRows) { while (reader.Read()) { entities.Add(new SearchEntity("Series", reader.GetString(0))); } } } } using (var command = new SQLiteCommand()) { command.CommandText = "Select distinct [Alt_Series] From [VideoRecords] Where [Deleted] = 0;"; using (var reader = accesser.ExecuteReader(command)) { if (reader.HasRows) { while (reader.Read()) { entities.Add(new SearchEntity("Alt Series", reader.GetNullableString(0))); } } } } return(entities); }
public static SearchEntityCollection GetSearchEntities(VideoSeries _series) { var entities = new SearchEntityCollection(); using (var command = new SQLiteCommand()) { command.CommandText = @"Select distinct [Text] From [VideoTags] t1 Inner Join [VideoRecords] t2 on t1.[Vid] = t2.[Vid] Where t1.[Deleted] = 0 and t2.[Series] = @series;"; command.Parameters.Add(new SQLiteParameter("@series") { DbType = DbType.String, Value = _series.Series }); using (var reader = accesser.ExecuteReader(command)) { if (reader.HasRows) { while (reader.Read()) { entities.Add(new SearchEntity("Tag", reader.GetString(0))); } } } } using (var command = new SQLiteCommand()) { command.CommandText = "Select distinct [Series] From [VideoRecords] Where [Deleted] = 0 and [Series] = @series;"; command.Parameters.Add(new SQLiteParameter("@series") { DbType = DbType.String, Value = _series.Series }); using (var reader = accesser.ExecuteReader(command)) { if (reader.HasRows) { while (reader.Read()) { entities.Add(new SearchEntity("Series", reader.GetString(0))); } } } } using (var command = new SQLiteCommand()) { command.CommandText = "Select distinct [Alt_Series] From [VideoRecords] Where [Deleted] = 0 and [Series] = @series;"; command.Parameters.Add(new SQLiteParameter("@series") { DbType = DbType.String, Value = _series.Series }); using (var reader = accesser.ExecuteReader(command)) { if (reader.HasRows) { while (reader.Read()) { entities.Add(new SearchEntity("Alt_Series", reader.GetNullableString(0))); } } } } return(entities); }
public static SearchEntityCollection GetSearchEntities(ClipRecord _clip) { var entities = new SearchEntityCollection(); using (var command = new SQLiteCommand()) { command.CommandText = @"Select distinct [Text] From [ClipTags] Where [Deleted] = 0 and [Cid] = @cid;"; command.Parameters.Add(new SQLiteParameter("@cid") { DbType = DbType.String, Value = _clip.Cid }); using (var reader = accesser.ExecuteReader(command)) { if (reader.HasRows) { while (reader.Read()) { entities.Add(new SearchEntity("Tag", reader.GetString(0))); } } } } using (var command = new SQLiteCommand()) { command.CommandText = "Select distinct [Author] From [ClipRecords] Where [Deleted] = 0 and [Cid] = @cid;"; command.Parameters.Add(new SQLiteParameter("@cid") { DbType = DbType.String, Value = _clip.Cid }); using (var reader = accesser.ExecuteReader(command)) { if (reader.HasRows) { while (reader.Read()) { entities.Add(new SearchEntity("Author", reader.GetString(0))); } } } } using (var command = new SQLiteCommand()) { command.CommandText = "Select distinct [Music] From [ClipRecords] Where [Deleted] = 0 and [Cid] = @cid;"; command.Parameters.Add(new SQLiteParameter("@cid") { DbType = DbType.String, Value = _clip.Cid }); using (var reader = accesser.ExecuteReader(command)) { if (reader.HasRows) { while (reader.Read()) { entities.Add(new SearchEntity("Music", reader.GetNullableString(0))); } } } } return(entities); }