superstar_v2/DBObj/ArtistManager.cs

34 lines
1.3 KiB
C#
Raw Normal View History

2025-04-07 16:54:10 +08:00
using System.Data.SQLite;
2025-04-18 15:22:47 +08:00
using System.IO;
using DualScreenDemo;
2025-04-07 16:54:10 +08:00
namespace DBObj
{
/**
*/
public class ArtistManager
{
public ArtistManager()
{
}
// 筆畫問題
2025-04-07 16:54:10 +08:00
public List<Artist> GetArtistsByCategoryAndStrokeCountRange(string category, int minStrokes, int maxStrokes)
{
if (category == "全部")
{
2025-04-18 15:22:47 +08:00
string query = $"SELECT * FROM ArtistLibrary WHERE 歌手筆畫 >= {minStrokes} AND 歌手筆畫 <={maxStrokes}";
var searchResults = PrimaryForm.SearchSingers_Mysql(query);
return searchResults;
//return AllArtists.Where(artist => artist.Strokes >= minStrokes && artist.Strokes <= maxStrokes).ToList();
2025-04-07 16:54:10 +08:00
}
else
{
2025-04-18 15:22:47 +08:00
string query = $"SELECT * FROM ArtistLibrary WHERE 歌手分類 = '{category}' AND 歌手筆畫 >= {minStrokes} AND 歌手筆畫 <={maxStrokes}";
var searchResults = PrimaryForm.SearchSingers_Mysql(query);
return searchResults;
//return AllArtists.Where(artist => artist.Category == category && artist.Strokes >= minStrokes && artist.Strokes <= maxStrokes).ToList();
2025-04-07 16:54:10 +08:00
}
}
}
}