You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
2.1 KiB
57 lines
2.1 KiB
using Newtonsoft.Json; |
|
using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Net.Http; |
|
using System.Text; |
|
using System.Text.Json; |
|
using System.Threading.Tasks; |
|
|
|
namespace Emergency_platform |
|
{ |
|
public class DAY |
|
{ |
|
public List<DayOfWeek> DayOfWeeks(PatrolClass item) |
|
{ |
|
DayOfWeek dayOfWeek; |
|
List<DayOfWeek> dayOfWeeks = new List<DayOfWeek>(); |
|
var runRule = item.RunRule; |
|
string[] days = runRule.Split(','); |
|
foreach (var day in days) |
|
{ |
|
switch (day) |
|
{ |
|
case "周一": |
|
dayOfWeek = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), "周一"); |
|
dayOfWeeks.Add(dayOfWeek); |
|
break; |
|
case "周二": |
|
dayOfWeek = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), "周二"); |
|
dayOfWeeks.Add(dayOfWeek); |
|
break; |
|
case "周三": |
|
dayOfWeek = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), "周三"); |
|
dayOfWeeks.Add(dayOfWeek); |
|
break; |
|
case "周四": |
|
dayOfWeek = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), "周四"); |
|
dayOfWeeks.Add(dayOfWeek); |
|
break; |
|
case "周五": |
|
dayOfWeek = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), "周五"); |
|
dayOfWeeks.Add(dayOfWeek); |
|
break; |
|
case "周六": |
|
dayOfWeek = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), "周六"); |
|
dayOfWeeks.Add(dayOfWeek); |
|
break; |
|
case "周日": |
|
dayOfWeek = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), "周日"); |
|
dayOfWeeks.Add(dayOfWeek); |
|
break; |
|
} |
|
} |
|
return dayOfWeeks; |
|
} |
|
} |
|
}
|
|
|