using System.Data.SQLite; 
using System.IO;
using DualScreenDemo;
namespace DBObj
{
    /** 
        從資料庫取資料回來
    */
    public class ArtistManager
    {
        public ArtistManager()
        {

        }
        // 筆畫問題
        public List<Artist> GetArtistsByCategoryAndStrokeCountRange(string category, int minStrokes, int maxStrokes)
        {
            if (category == "全部")
            {
                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();
            }
            else
            {
                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();
            }
        }
    }
}