static public User Parse(IEnumerable <User> data, string Name, DateTime Date) { User NewUser = new User(); try { NewUser.Name = ParseName(Name); NewUser.BirthDay = Date; NewUser.CalculateAge(); } catch (ArgumentException e) { throw e; } NewUser.Id = NewUser.GetNewId(data); return(NewUser); }
static public User Parse(IEnumerable <User> data, params string[] Answers) { User NewUser = new User(); try { NewUser.Name = ParseName(Answers[0]); NewUser.BirthDay = ParseBirthDate(Answers[1]); NewUser.CalculateAge(); NewUser.Age = ParseAge(NewUser.Age, Answers[2]); } catch (ArgumentException e) { throw e; } NewUser.Id = NewUser.GetNewId(data); return(NewUser); }