using System;

namespace Hotline.Tools
{
    public static class WeekTool
    {
        public static string GetWeekNum()
        {
            var DayOfWeek = DateTime.Now.DayOfWeek;
            switch (DayOfWeek)
            {
                case DayOfWeek.Sunday:
                    return "0";
                case DayOfWeek.Monday:
                    return "1";
                case DayOfWeek.Tuesday:
                    return "2";
                case DayOfWeek.Wednesday:
                    return "3";
                case DayOfWeek.Thursday:
                    return "4";
                case DayOfWeek.Friday:
                    return "5";
                case DayOfWeek.Saturday:
                    return "6";
                default:
                    return "-1";
            }
        }

        public static int GetWeekNum(DateTime datetime)
        {
            var DayOfWeek = datetime.DayOfWeek;
            switch (DayOfWeek)
            {
                case DayOfWeek.Sunday:
                    return 0;
                case DayOfWeek.Monday:
                    return 1;
                case DayOfWeek.Tuesday:
                    return 2;
                case DayOfWeek.Wednesday:
                    return 3;
                case DayOfWeek.Thursday:
                    return 4;
                case DayOfWeek.Friday:
                    return 5;
                case DayOfWeek.Saturday:
                    return 6;
                default:
                    return -1;
            }
        }

        /// <summary>
        /// 是否工作日
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        public static bool IsWorkDay(DateTime date)
        {
            var DayOfWeek = date.DayOfWeek;

            if ((int)DayOfWeek==0 || (int)DayOfWeek==6)
            {
                return false;
            }
            return true;
        }


    }
}
