using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NEIntelligentControl2.Models.WinForms
{
    public class SearchCondition
    {
        //设备Id
        public string objectId { get; set; } = "";


        //场站Id
        public string stationId { get; set; } = "";

        // 根据stationid返回文字名称
        public string StationName
        {
            get
            {
                switch (stationId)
                {
                    case "MHS_FDC":
                        return "麻黄山风电场";
                    case "NSS_FDC":
                        return "牛首山风电场";
                    case "SBQ_FDC":
                        return "石板泉风电场";
                    case "XS_FDC":
                        return "香山风电场";
                    case "QS_FDC":
                        return "青山风电场";
                    case "MCH_GDC":
                        return "马场湖光伏电站";
                    case "DWK_GDC":
                        return "大武口光伏电站";
                    case "PL_GDC":
                        return "平罗光伏电站";
                    case "XH_GDC":
                        return "宣和光伏电站";
                    case "HZJ_GDC":
                        return "海子井光伏电站";
                    default:
                        return "全部";
                }
            }
            set
            {
                switch (value)
                {
                    case "麻黄山风电场":
                        {
                            stationId = "MHS_FDC";
                            break;
                        }
                    case "牛首山风电场":
                        {
                            stationId = "NSS_FDC";
                            break;
                        }
                    case "石板泉风电场":
                        {
                            stationId = "SBQ_FDC";
                            break;
                        }
                    case "香山风电场":
                        {
                            stationId = "XS_FDC";
                            break;
                        }
                    case "青山风电场":
                        {
                            stationId = "QS_FDC";
                            break;
                        }
                    case "大武口光伏电站":
                        {
                            stationId = "DWK_GDC";
                            break;
                        }
                    case "平罗光伏电站":
                        {
                            stationId = "PL_GDC";
                            break;
                        }
                    case "宣和光伏电站":
                        {
                            stationId = "XH_GDC";
                            break;
                        }
                    case "马场湖光伏电站":
                        stationId = "MCH_GDC";
                        break;
                    case "海子井光伏电站":
                        stationId = "HZJ_GDC";
                        break;
                    default:
                        {
                            stationId = "";
                            break;
                        }
                }
            }
        }

        //开始时间
        public DateTime startTime { get; set; }

        //结束时间
        public DateTime endTime { get; set; }

        //级别
        public string rank { get; set; } = "";

        public string RankText
        {
            /*
             * 全部
             * 5 高
             * 4 中高
             * 3 中
             * 2 中低
             * 1 低
             */
            get
            {
                switch (rank)
                {
                    case "5":
                        {
                            return "高";
                        }
                    case "4":
                        {
                            return "中高";
                        }
                    case "3":
                        {
                            return "中";
                        }
                    case "2":
                        {
                            return "中低";
                        }
                    case "1":
                        {
                            return "低";
                        }
                    default:
                        {
                            return "全部";
                        }
                }
            }
            set
            {
                switch (value)
                {
                    case "高":
                        {
                            rank = "5";
                            break;
                        }
                    case "中高":
                        {
                            rank = "4";
                            break;
                        }
                    case "中":
                        {
                            rank = "3";
                            break;
                        }
                    case "中低":
                        {
                            rank = "2";
                            break;
                        }
                    case "低":
                        {
                            rank = "1";
                            break;
                        }
                    default:
                        {
                            rank = "";
                            break;
                        }
                }
            }

        }

        //类型
        public string cateGory1 { get; set; } = "";

        public string CateGoryText
        {
            /*
             * 全部
             * 自定义
             * 风机
             * 升压站
             * 光伏
             */
            get
            {
                switch (cateGory1)
                {
                    case "windturbine":
                        {
                            return "风机";
                        }
                    case "GF":
                        {
                            return "光伏";
                        }
                    case "SYZ":
                        {
                            return "升压站";
                        }
                    case "custom":
                        {
                            return "自定义";
                        }
                    default:
                        {
                            return "全部";
                        }
                }
            }
            set
            {
                switch (value)
                {
                    case "风机":
                        {
                            cateGory1 = "windturbine";
                            break;
                        }
                    case "光伏":
                        {
                            cateGory1 = "GF";
                            break;
                        }
                    case "升压站":
                        {
                            cateGory1 = "SYZ";
                            break;
                        }
                    case "自定义":
                        {
                            cateGory1 = "custom";
                            break;
                        }
                    default:
                        {
                            cateGory1 = "";
                            break;
                        }
                }
            }
        }

        //子类型   //全部
        public string cateGory2 { get; set; } = "";

        //关键字
        public string keyText { get; set; } = "";

        //页码
        public int pageIndex { get; set; } = 1;

        //页面大小
        public int pageSize { get; set; } = 100;



        public SearchCondition Clone()
        {
            return MemberwiseClone() as SearchCondition;
        }
    }
}
