public TreePerson(PersonType Type, string idString = "", Person familySearchPerson = null) { switch (Type) { case PersonType.Null: Name = Death = ""; Sex = PersonSex.NotSet; Birth = idString; break; case PersonType.Unique: var perRandom = StaticRandom.RandomNumber(0, 100); //Debug.WriteLine("Random " + perRandom); if (perRandom > 49) { Sex = PersonSex.Male; Name = MaleNames[StaticRandom.RandomNumber(0, MaleNames.Length)]; Birth = idString; } else { Sex = PersonSex.Female; Name = FemaleNames[StaticRandom.RandomNumber(0, FemaleNames.Length)]; Birth = idString; } break; case PersonType.Adam: Sex = PersonSex.Male; Name = "Adam"; Birth = idString; BirthFamilyIndex = 0; // from Generation 0 break; case PersonType.Eve: Sex = PersonSex.Female; Name = "Eve"; Birth = idString; BirthFamilyIndex = 0; // from Generation 0 break; case PersonType.FamilySearch: if (familySearchPerson != null) { _familSearchPerson = familySearchPerson; // Just the basics of the person are set now Name = familySearchPerson.DisplayExtension.Name; Sex = GetSexEnum(familySearchPerson.DisplayExtension.Gender); Birth = familySearchPerson.DisplayExtension.BirthDate ?? ""; Death = familySearchPerson.DisplayExtension.DeathDate ?? ""; Lifespan = familySearchPerson.DisplayExtension.Lifespan; _familySearchID = familySearchPerson.Id; } break; } myEvents = new List<FamilyEvent>(); }
public Person(string aName, string aPhone, DateTime aBirthDate, Color aColor, PersonSex aPresonSex) { Name = aName; Phone = aPhone; BirthDate = aBirthDate; SomeColor = new SolidColorBrush(aColor); Sex = aPresonSex; }
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { return(null); } PersonSex sex; if (!PersonSex.TryParse((string)value, out sex)) { return(null); } return(sex); }
public TreePerson(PersonType Type, string birth = "", TreePerson familySearchTreePerson = null) { switch (Type) { case PersonType.Null: Name = Death = ""; Sex = PersonSex.NotSet; Birth = birth; break; case PersonType.Unique: if (Random.Range(0, 2) == 0) { Sex = PersonSex.Male; Name = MaleNames[Random.Range(0, MaleNames.Length)]; Birth = birth; } else { Sex = PersonSex.Female; Name = FemaleNames[Random.Range(0, FemaleNames.Length)]; Birth = birth; } break; case PersonType.Adam: Sex = PersonSex.Male; Name = "Adam"; Birth = birth; BirthFamilyIndex = 0; // from Generation 0 break; case PersonType.Eve: Sex = PersonSex.Female; Name = "Eve"; Birth = birth; BirthFamilyIndex = 0; // from Generation 0 break; case PersonType.FamilySearch: break; } myEvents = new List <FamilyEvent>(); }
public TreePerson(PersonType Type, string birth = "", TreePerson familySearchTreePerson = null) { switch (Type) { case PersonType.Null: Name = Death = ""; Sex = PersonSex.NotSet; Birth = birth; break; case PersonType.Unique: if (Random.Range(0, 2) == 0) { Sex = PersonSex.Male; Name = MaleNames[Random.Range(0,MaleNames.Length)]; Birth = birth; } else { Sex = PersonSex.Female; Name = FemaleNames[Random.Range(0,FemaleNames.Length)]; Birth = birth; } break; case PersonType.Adam: Sex = PersonSex.Male; Name = "Adam"; Birth = birth; BirthFamilyIndex = 0; // from Generation 0 break; case PersonType.Eve: Sex = PersonSex.Female; Name = "Eve"; Birth = birth; BirthFamilyIndex = 0; // from Generation 0 break; case PersonType.FamilySearch: break; } myEvents = new List<FamilyEvent>(); }
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { Contact contact = (Contact)values[0]; if (contact == null) { return(null); } if (!string.IsNullOrEmpty(contact.CustomPicture) && File.Exists(contact.CustomPicture)) { return(new BitmapImage(new Uri(contact.CustomPicture, UriKind.RelativeOrAbsolute))); } PersonSex sex = contact.Sex; return(new BitmapImage(new Uri(sex == PersonSex.Male ? "man.png" : "woman.jpg", UriKind.RelativeOrAbsolute))); }
static string GetNextName(out PersonSex sex) { if (currentPersonSex == PersonSex.Male) { sex = PersonSex.Male; currentPersonSex = PersonSex.Female; if (currentPersonMaleName >= maleNames.Length) { currentPersonMaleName = 0; } return(maleNames[currentPersonMaleName++]); } sex = PersonSex.Female; currentPersonSex = PersonSex.Male; if (currentPersonFemaleName >= femaleNames.Length) { currentPersonFemaleName = 0; } return(femaleNames[currentPersonFemaleName++]); }
public Person() { Id = Constants.NONE; FatherId = Constants.NONE; MotherId = Constants.NONE; Name = string.Empty; FatherName = string.Empty; MotherName = string.Empty; CityId = Constants.NONE; Street = string.Empty; House = Constants.NONE; CountryId = Constants.NONE; BirthDate = string.Empty; Sex = PersonSex.Unknown; }
public UserVO(string fname, string lname, PersonSex sex, string department, string phoneNum, string email) { if (!string.IsNullOrEmpty(fname)) { _FirstName = fname; } if (!string.IsNullOrEmpty(lname)) { _LastName = lname; } Sex = sex; if (!string.IsNullOrEmpty(department)) { Department = department; } if (!string.IsNullOrEmpty(phoneNum)) { PhoneNum = phoneNum; } if (!string.IsNullOrEmpty(email)) { Email = email; } }
public DoctorViewModel CreateDoctor(String name = "NoName", DoctorStatus status = DoctorStatus.NotWork, PersonSex sex = PersonSex.Male) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException(nameof(name)); } return(new DoctorViewModel() { Name = name, Sex = sex, Status = status }); }
public PatientViewModel CreatePatient(String name = "NoName", PatientStatus status = PatientStatus.Healthy, PersonSex sex = PersonSex.Male) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException(nameof(name)); } return(new PatientViewModel() { Name = name, Sex = sex, Status = status }); }
private void Btn_Click(object sender, EventArgs e) { string method = MethodBase.GetCurrentMethod().Name; string result; try { #region City int cityId = Constants.NONE; if (!string.IsNullOrEmpty(cboCity.Text)) { if (!cities.GetCityIdByCityName(cboCity.Text, out cityId, out result)) { Audit(result, method, LINE(), AuditSeverity.Warning); } } #endregion #region Country int countryId = Constants.NONE; if (!string.IsNullOrEmpty(cboCountry.Text)) { if (!countries.GetCountryIdByCountryName(cboCountry.Text, out countryId, out result)) { Audit(result, method, LINE(), AuditSeverity.Warning); } } #endregion #region Sex PersonSex sex = new PersonSex(); switch (cboSex.Text) { case "זכר": sex = PersonSex.Male; break; case "נקבה": sex = PersonSex.Female; break; default: sex = PersonSex.Unknown; break; } #endregion #region IDs int id = int.TryParse(txtId.Text, out id) ? id : Constants.NONE; int fatherId = int.TryParse(txtFatherId.Text, out fatherId) ? fatherId : Constants.NONE; int motherId = int.TryParse(txtMotherId.Text, out motherId) ? motherId : Constants.NONE; #endregion Person searchFilter = new Person() { Id = id, FatherId = fatherId, MotherId = motherId, Name = txtName.Text, FatherName = txtFatherName.Text, MotherName = txtMotherName.Text, Family = txtFamily.Text, OldFamily = txtOldFamily.Text, Street = txtStreet.Text, House = (int)nudHouse.Value, CityId = cityId, CountryId = countryId, Sex = sex, BirthDateYear = cboYear.Text, BirthDateMonth = cboMonth.Text, BirthDateDay = cboDay.Text }; OnSearchParameter(searchFilter); } catch (Exception ex) { Audit(ex.Message, method, LINE(), AuditSeverity.Error); } }