public Zodiak(string name, string surname, ZodiakTypes zodiakType, DateTime birthday) { this.name = name; this.surname = surname; this.zodiakType = zodiakType; this.birthday = birthday; }
public static bool IsValidate(ZodiakTypes zodiakType, DateTime birthday) { ZodiakTypesDateTable.TryGetValue(zodiakType, out DateTime[] datetimes); return (birthday.DayOfYear >= datetimes[0].DayOfYear && birthday.DayOfYear <= datetimes[1].DayOfYear); }
public static (string, string, ZodiakTypes, DateTime) SplitData(string data) { var str = data.Split(); string name = str[0]; string surname = str[1]; ZodiakTypes zodiakType = (ZodiakTypes)Enum.Parse(typeof(ZodiakTypes), str[2]); var b_day_arr = str[3].Split('.').Select(int.Parse).ToArray(); DateTime birthday = new DateTime(b_day_arr[2], b_day_arr[1], b_day_arr[0]); return(name, surname, zodiakType, birthday); }