public bool HasMissingDetails() { return(!(ID > -1 && Name != null && !Name.Trim().Equals("") && Surname != null && !Surname.Trim().Equals(""))); }
//Methods public override string ToString() { return(string.Format($"{Surname.ToUpper()}, {FirstName} - {WorkType}")); }
/// <summary> /// Returns true if User instances are equal /// </summary> /// <param name="other">Instance of User to be compared</param> /// <returns>Boolean</returns> public bool Equals(User other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id.Equals(other.Id) ) && ( GivenName == other.GivenName || GivenName != null && GivenName.Equals(other.GivenName) ) && ( Surname == other.Surname || Surname != null && Surname.Equals(other.Surname) ) && ( Active == other.Active || Active.Equals(other.Active) ) && ( Initials == other.Initials || Initials != null && Initials.Equals(other.Initials) ) && ( Email == other.Email || Email != null && Email.Equals(other.Email) ) && ( SmUserId == other.SmUserId || SmUserId != null && SmUserId.Equals(other.SmUserId) ) && ( Guid == other.Guid || Guid != null && Guid.Equals(other.Guid) ) && ( SmAuthorizationDirectory == other.SmAuthorizationDirectory || SmAuthorizationDirectory != null && SmAuthorizationDirectory.Equals(other.SmAuthorizationDirectory) ) && ( UserRoles == other.UserRoles || UserRoles != null && UserRoles.SequenceEqual(other.UserRoles) ) && ( District == other.District || District != null && District.Equals(other.District) ) && ( UserDistricts == other.UserDistricts || UserDistricts != null && UserDistricts.SequenceEqual(other.UserDistricts) )); }
/// <summary> /// Checks if a PlayerStatistics object is equal to a given PlayerStatistics object /// </summary> /// <param name="other">player object to check for equality</param> /// <returns>true if objects are equal, false otherwise</returns> public bool Equals(PlayerStatistics other) { return(Team.Equals(other.Team) && Name.Equals(other.Name) && Surname.Equals(other.Surname) && MinutesPlayed == other.MinutesPlayed && PointsScored == other.PointsScored && FoulsMade == other.FoulsMade); }
public override int GetHashCode() { return(this.Name.GetHashCode() * dateOfBorn.GetHashCode() * Surname.GetHashCode()); }
public override string Print() { return($"Name: {Firstname.PadRight(7)} Surname: {Surname.PadRight(10)} Age: {Age} Position: {Po}"); }
private async void Volver_Login(object sender, EventArgs e) { if (string.IsNullOrEmpty(Name.Text)) { await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos su nombre.", "Ok"); Name.Focus(); return; } if (string.IsNullOrEmpty(Surname.Text)) { await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuáles son sus apellidos.", "Ok"); Surname.Focus(); return; } if (string.IsNullOrEmpty(elNick.Text)) { await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuál será su Nick de Usuario.", "Ok"); elNick.Focus(); return; } if (pickerSexo.SelectedIndex == -1) { await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuál es su sexo.", "Ok"); pickerSexo.Focus(); return; } if (string.IsNullOrEmpty(correoE.Text)) { await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos su correo electrónico.", "Ok"); correoE.Focus(); return; } if (!emailValidator.IsValid) { await DisplayAlert("Correo inválido", "Debe ingresar una dirección de correo electrónico válida.", "Ok"); correoE.Focus(); return; } if (string.IsNullOrEmpty(Passwordd.Text)) { await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, introduzca su contraseña.", "Ok"); Passwordd.Focus(); return; } if (string.IsNullOrEmpty(Phone.Text)) { await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos su número de teléfono.", "Ok"); Phone.Focus(); return; } if (Phone.Text.Length < 9) { await DisplayAlert("Número de teléfono inválido", "El número de teléfono debe tener al menos 9 dígitos.", "Ok"); Phone.Focus(); return; } if (string.IsNullOrEmpty(skypeUser.Text)) { await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos su nombre de Usuario de Skype.", "Ok"); skypeUser.Focus(); return; } if (pickerNivel.SelectedIndex == -1) { await DisplayAlert("Existen campos obligatorios vacíos", "Por favor, indíquenos cuál es su nivel de inglés actual.", "Ok"); pickerNivel.Focus(); return; } modelo.UserView m = this.BindingContext as modelo.UserView; if ((m != null) && (m.Guardar.CanExecute(null))) { m.Guardar.Execute(null); await DisplayAlert("¡¡¡Enhorabuena!!!", "Ya eres TWENIX!!", "Volver al Menú Principal"); await Navigation.PushAsync(new MainPage()); } }
void Serch(object a) { List <Person> list = new List <Person>(); if (!string.IsNullOrWhiteSpace(Surname) && string.IsNullOrWhiteSpace(Name) && string.IsNullOrWhiteSpace(Father_Name) && Client_Code == 0 && string.IsNullOrWhiteSpace(Fin_Code)) { IEnumerable <Person> serchresult = from person in MyRepository.PeopleRepository where person.Surname.ToLower() == Surname.ToLower() select person; list = serchresult.ToList(); } else if (!string.IsNullOrWhiteSpace(Surname) && !string.IsNullOrWhiteSpace(Name) && string.IsNullOrWhiteSpace(Father_Name) && Client_Code == 0 && string.IsNullOrWhiteSpace(Fin_Code)) { IEnumerable <Person> serchresult = from person in MyRepository.PeopleRepository where person.Surname.ToLower() == Surname.ToLower() & person.Name.ToLower() == Name.ToLower() select person; list = serchresult.ToList(); } else if (!string.IsNullOrWhiteSpace(Surname) && !string.IsNullOrWhiteSpace(Name) && !string.IsNullOrWhiteSpace(Father_Name) && Client_Code == 0 && string.IsNullOrWhiteSpace(Fin_Code)) { IEnumerable <Person> serchresult = from person in MyRepository.PeopleRepository where person.Surname.ToLower() == Surname.ToLower() & person.Name.ToLower() == Name.ToLower() & person.Father_name.ToLower() == Father_Name.ToLower() select person; list = serchresult.ToList();; } else if (Client_Code != 0) { IEnumerable <Person> serchresult = from person in MyRepository.PeopleRepository where person.ClientCode == Client_Code select person; list = serchresult.ToList(); } else if (!string.IsNullOrWhiteSpace(Fin_Code)) { IEnumerable <Person> serchresult = from person in MyRepository.PeopleRepository where person.FinCode.ToLower() == Fin_Code.ToLower() select person; list = serchresult.ToList(); } else if (!string.IsNullOrWhiteSpace(Surname) && !string.IsNullOrWhiteSpace(Father_Name)) { IEnumerable <Person> serchresult = from person in MyRepository.PeopleRepository where person.Surname.ToLower() == Surname.ToLower() & person.Father_name.ToLower() == Father_Name.ToLower() select person; list = serchresult.ToList(); } else if (!string.IsNullOrWhiteSpace(Name) && !string.IsNullOrWhiteSpace(Father_Name)) { IEnumerable <Person> serchresult = from person in MyRepository.PeopleRepository where person.Name.ToLower() == Name.ToLower() & person.Father_name.ToLower() == Father_Name.ToLower() select person; list = serchresult.ToList(); } else if (!string.IsNullOrWhiteSpace(Father_Name)) { IEnumerable <Person> serchresult = from person in MyRepository.PeopleRepository where person.Father_name.ToLower() == Father_Name.ToLower() select person; list = serchresult.ToList(); } else if (!string.IsNullOrWhiteSpace(Name)) { IEnumerable <Person> serchresult = from person in MyRepository.PeopleRepository where person.Name.ToLower() == Name.ToLower() select person; list = serchresult.ToList(); } ClientSerchResult.Clear(); foreach (var item in list) { ClientSerchResult.Add(item); } }
/// <summary> /// Returns true if Contact instances are equal /// </summary> /// <param name="other">Instance of Contact to be compared</param> /// <returns>Boolean</returns> public bool Equals(Contact other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id.Equals(other.Id) ) && ( GivenName == other.GivenName || GivenName != null && GivenName.Equals(other.GivenName) ) && ( Surname == other.Surname || Surname != null && Surname.Equals(other.Surname) ) && ( Role == other.Role || Role != null && Role.Equals(other.Role) ) && ( Notes == other.Notes || Notes != null && Notes.Equals(other.Notes) ) && ( EmailAddress == other.EmailAddress || EmailAddress != null && EmailAddress.Equals(other.EmailAddress) ) && ( WorkPhoneNumber == other.WorkPhoneNumber || WorkPhoneNumber != null && WorkPhoneNumber.Equals(other.WorkPhoneNumber) ) && ( MobilePhoneNumber == other.MobilePhoneNumber || MobilePhoneNumber != null && MobilePhoneNumber.Equals(other.MobilePhoneNumber) ) && ( FaxPhoneNumber == other.FaxPhoneNumber || FaxPhoneNumber != null && FaxPhoneNumber.Equals(other.FaxPhoneNumber) ) && ( Address1 == other.Address1 || Address1 != null && Address1.Equals(other.Address1) ) && ( Address2 == other.Address2 || Address2 != null && Address2.Equals(other.Address2) ) && ( City == other.City || City != null && City.Equals(other.City) ) && ( Province == other.Province || Province != null && Province.Equals(other.Province) ) && ( PostalCode == other.PostalCode || PostalCode != null && PostalCode.Equals(other.PostalCode) )); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks hash = hash * 59 + Id.GetHashCode(); if (GivenName != null) { hash = hash * 59 + GivenName.GetHashCode(); } if (Surname != null) { hash = hash * 59 + Surname.GetHashCode(); } if (Role != null) { hash = hash * 59 + Role.GetHashCode(); } if (Notes != null) { hash = hash * 59 + Notes.GetHashCode(); } if (EmailAddress != null) { hash = hash * 59 + EmailAddress.GetHashCode(); } if (WorkPhoneNumber != null) { hash = hash * 59 + WorkPhoneNumber.GetHashCode(); } if (MobilePhoneNumber != null) { hash = hash * 59 + MobilePhoneNumber.GetHashCode(); } if (FaxPhoneNumber != null) { hash = hash * 59 + FaxPhoneNumber.GetHashCode(); } if (Address1 != null) { hash = hash * 59 + Address1.GetHashCode(); } if (Address2 != null) { hash = hash * 59 + Address2.GetHashCode(); } if (City != null) { hash = hash * 59 + City.GetHashCode(); } if (Province != null) { hash = hash * 59 + Province.GetHashCode(); } if (PostalCode != null) { hash = hash * 59 + PostalCode.GetHashCode(); } return(hash); } }
public override bool Equals(object obj) { Person p = (Person)obj; return(Name.Equals(p.Name) && Surname.Equals(p.Surname) && Birthday.Equals(p.Birthday)); }
// чтобы уменьшить количество повторяющихся хэш-кодов public override int GetHashCode() { return(Name.GetHashCode() * 41 + Surname.GetHashCode() * 37 + Birthday.GetHashCode() * 31); }
public override string ToString() { return(Surname.ToString()); }
public staffSpec(DataRowView aDRV) { // SJL 20090427 // changed to allow for a DELETED wcStaffIdentity Record // If the wcStaffIdentity Record is deleted then get the QLid from the actiondata // and set the NDSname to the NetworkName of the Coupler job if (aDRV["whenRead"].ToString().Trim().Length > 0) { WhenRead = true; } if (String.IsNullOrEmpty(aDRV["NDSName"].ToString()) | aDRV["NDSName"].ToString().Length < 1) { keepProxy = false; ActionData = aDRV["actionData"].ToString().Trim(); String[] AD = aDRV["actionData"].ToString().Trim().Split('='); if (AD[0].ToString().ToLower() == "empnum") { QLId = AD[1].ToString(); } else { QLId = aDRV["EmployeeNumber"].ToString().Trim(); } NDSName = aDRV["NetworkName"].ToString().Trim(); EmailAddress = NDSName + "@warkscol.ac.uk"; StaffID = "Deleted"; Forename = "Deleted"; Surname = "Deleted"; SQLSurname = "Deleted"; Site = "Deleted"; DeptCode = "Deleted"; Department = "Deleted"; JobTitle = "Deleted"; EmpType = "Deleted"; Tel = "Deleted"; if (!String.IsNullOrEmpty(aDRV["queueItem"].ToString())) { queueItem = (int)aDRV["queueItem"]; } if (!String.IsNullOrEmpty(aDRV["attempts"].ToString())) { attempts = (int)aDRV["attempts"]; } if (!String.IsNullOrEmpty(aDRV["action"].ToString())) { action = aDRV["action"].ToString(); } LocID = "Deleted"; GWise = false; Context = ".staff.lspa.wc"; HomeVol = ".orion_home.lspa.wc"; SecondHomeVol = ".orion_gwarc.lspa.wc"; ThirdHomeVol = ".orion_home.lspa.wc"; Template = "LSPA_AUTOTEMPLATE"; Profile = ".LSPASTAFF.STAFF.LSPA.WC"; PostOffice = "po-lspa.warkscollege"; SharedVolRestrict = ".orion_shared.lspa.wc:250000"; GroupMembership = ".STA_0ther.VDI_GROUPS.LSPA.WC"; Vol1VolRestrict = ".orion_student_vol1.lspa.wc:20000"; } else { if (aDRV["keepProxy"].ToString().Trim().ToLower() == "true") { keepProxy = true; } NDSName = aDRV["NDSName"].ToString().Trim(); staffGroup = ".STA_0ther.VDI_GROUPS.LSPA.WC";//default group staffStartChar = NDSName.ToString().Trim().Substring(0, 1).ToUpper(); if ("ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains(staffStartChar)) { staffGroup = ".STA_" + staffStartChar.ToString() + ".VDI_GROUPS.LSPA.WC"; } EmailAddress = NDSName + "@warkscol.ac.uk"; EmailAddressGoogle = NDSName + "@warwickshire.ac.uk"; QLId = aDRV["EmployeeNumber"].ToString().Trim(); EmpID = aDRV["EmployeeNumber"].ToString().Trim(); StaffID = QLId.Trim().PadLeft(8, '0'); Forename = aDRV["forename"].ToString().Trim(); Surname = aDRV["surname"].ToString().Trim(); SQLSurname = Surname.Replace("'", "''"); Site = aDRV["loc_id"].ToString().Trim(); DeptCode = aDRV["department"].ToString().Trim(); Department = aDRV["department"].ToString().Trim(); JobTitle = aDRV["job_title"].ToString().Trim(); EmpType = aDRV["emp_type"].ToString().Trim(); Tel = aDRV["Telephone"].ToString().Trim(); ActionData = aDRV["actionData"].ToString().Trim(); if (!String.IsNullOrEmpty(aDRV["queueItem"].ToString())) { queueItem = (int)aDRV["queueItem"]; } if (!String.IsNullOrEmpty(aDRV["attempts"].ToString())) { attempts = (int)aDRV["attempts"]; } if (!String.IsNullOrEmpty(aDRV["action"].ToString())) { action = aDRV["action"].ToString(); } LocID = aDRV["loc_id"].ToString().Trim(); // GWise = (Boolean)aDRV["statusGroupwise"]; GWise = false; Context = ".staff.lspa.wc"; HomeVol = ".orion_home.lspa.wc"; SecondHomeVol = ".orion_gwarc.lspa.wc"; ThirdHomeVol = ".orion_home.lspa.wc"; Template = "LSPA_AUTOTEMPLATE"; Profile = ".LSPASTAFF.STAFF.LSPA.WC"; PostOffice = "po-lspa.warkscollege"; SharedVolRestrict = ".orion_shared.lspa.wc:250000"; Vol1VolRestrict = ""; GroupMembership = staffGroup.ToString(); switch (LocID.ToUpper()) { case "LEAMINGTON SPA": Vol1VolRestrict = ".orion_student_vol1.lspa.wc:20000"; break; case "RUGBY": Context = ".staff.rug.wc"; Template = "RUG_AUTOTEMPLATE"; HomeVol = ".ka_staff_home.rug.wc"; SecondHomeVol = ".ka_gwarc.rug.wc"; ThirdHomeVol = ".ka_staff_home.rug.wc"; Profile = ".RUGSTAFF.STAFF.LSPA.WC"; PostOffice = "po-rugby.warkscollege"; SharedVolRestrict = ".ka_staff_shared.rug.wc:250000"; Vol1VolRestrict = ".ka_student_vol1.rug.wc:20000"; //GroupMembership = "._ALL-RUGBY-STAFF.GROUPWISE.WC"; break; case "TRIDENT PARK": Context = ".staff.trident.wc"; HomeVol = ".rover_staff_home.trident.wc"; SecondHomeVol = ".rover_gwarc.trident.wc"; ThirdHomeVol = ".rover_staff_home.trident.wc"; Template = "TRI_AUTOTEMPLATE"; Profile = ".TRISTAFF.STAFF.LSPA.WC"; PostOffice = "po-lspa.warkscollege"; SharedVolRestrict = ".orion_shared.lspa.wc:250000"; //GroupMembership = "._ALL-TRIDENT-STAFF.GROUPWISE.WC"; break; case "MORETON MORRELL": Context = ".staff.mm.wc"; HomeVol = ".sierra_staff_home.mm.wc"; SecondHomeVol = ".sierra_gwarc.mm.wc"; ThirdHomeVol = ".sierra_staff_home.mm.wc"; Template = "MM_AUTOTEMPLATE"; Profile = ".MMSTAFF.STAFF.LSPA.WC"; PostOffice = "po-mm.warkscollege"; SharedVolRestrict = ".sierra_staff_shared.mm.wc:250000"; //GroupMembership = "._ALL-MORETON-STAFF.GROUPWISE.WC"; break; case "HENLEY IN ARDEN": Context = ".staff.ardn.wc"; HomeVol = ".nova_staff_home.ardn.wc"; SecondHomeVol = ".nova_gwarc.ardn.wc"; ThirdHomeVol = ".nova_staff_home.ardn.wc"; Template = "ARDN_AUTOTEMPLATE"; Profile = ".ARDNSTAFF.STAFF.LSPA.WC"; PostOffice = "po-lspa.warkscollege"; SharedVolRestrict = ".orion_shared.lspa.wc:250000"; //GroupMembership = "._ALL-HENLEY-STAFF.GROUPWISE.WC"; break; case "PERSHORE": Context = ".staff.per.wc"; HomeVol = ".bravo_staff_home.per.wc"; SecondHomeVol = ".bravo_gwarc.per.wc"; ThirdHomeVol = ".bravo_staff_home.per.wc"; Template = "LSPA_AUTOTEMPLATE"; PostOffice = "po-per.warkscollege"; SharedVolRestrict = ".bravo_staff_shared.per.wc:250000"; //GroupMembership = "._ALL-PERSHORE-STAFF.GROUPWISE.WC"; break; default: break; } } HomeVolRestrict = HomeVol + ":20000"; }
public override string ToString() { return(string.Format("{0} {1} {2}", Name.PadRight(10), Surname.PadRight(10), WorkPosition.PadRight(10))); }
/// <summary> /// Returns true if User instances are equal /// </summary> /// <param name="other">Instance of User to be compared</param> /// <returns>Boolean</returns> public bool Equals(User other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Uuid == other.Uuid || Uuid != null && Uuid.Equals(other.Uuid) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( Surname == other.Surname || Surname != null && Surname.Equals(other.Surname) ) && ( Username == other.Username || Username != null && Username.Equals(other.Username) ) && ( Email == other.Email || Email != null && Email.Equals(other.Email) ) && ( PhoneNumber == other.PhoneNumber || PhoneNumber != null && PhoneNumber.Equals(other.PhoneNumber) ) && ( Avatar == other.Avatar || Avatar != null && Avatar.Equals(other.Avatar) ) && ( IsDeleted == other.IsDeleted || IsDeleted.Equals(other.IsDeleted) ) && ( LdapAuthenticationModeId == other.LdapAuthenticationModeId || LdapAuthenticationModeId != null && LdapAuthenticationModeId.Equals(other.LdapAuthenticationModeId) ) && ( Roles == other.Roles || Roles != null && other.Roles != null && Roles.SequenceEqual(other.Roles) ) && ( Teams == other.Teams || Teams != null && other.Teams != null && Teams.SequenceEqual(other.Teams) )); }
public int CompareTo(Employee obj) { return(Surname.CompareTo(obj.Surname)); }
/// <summary> /// Returns true if SecurityContractDefaultConfigurationUser instances are equal /// </summary> /// <param name="other">Instance of SecurityContractDefaultConfigurationUser to be compared</param> /// <returns>Boolean</returns> public bool Equals(SecurityContractDefaultConfigurationUser other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Uuid == other.Uuid || Uuid != null && Uuid.Equals(other.Uuid) ) && ( Username == other.Username || Username != null && Username.Equals(other.Username) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( Surname == other.Surname || Surname != null && Surname.Equals(other.Surname) ) && ( Email == other.Email || Email != null && Email.Equals(other.Email) ) && ( PhoneNumber == other.PhoneNumber || PhoneNumber != null && PhoneNumber.Equals(other.PhoneNumber) ) && ( Password == other.Password || Password != null && Password.Equals(other.Password) ) && ( HashedPassword == other.HashedPassword || HashedPassword != null && HashedPassword.Equals(other.HashedPassword) ) && ( IsDeleted == other.IsDeleted || IsDeleted.Equals(other.IsDeleted) ) && ( DeletedTime == other.DeletedTime || DeletedTime != null && DeletedTime.Equals(other.DeletedTime) ) && ( Avatar == other.Avatar || Avatar != null && Avatar.Equals(other.Avatar) ) && ( LdapAuthenticationMode == other.LdapAuthenticationMode || LdapAuthenticationMode != null && LdapAuthenticationMode.Equals(other.LdapAuthenticationMode) ) && ( Roles == other.Roles || Roles != null && other.Roles != null && Roles.SequenceEqual(other.Roles) )); }
public int CompareTo(object obj) { Employee tmp = (Employee)obj; return(Surname.CompareTo(tmp.Surname)); }
public void RedactInfo(int inputNumber) { switch (inputNumber) { case 1: Surname = ""; while (Surname.Trim() == "") { Console.Write("\nФамилия*: "); Surname = Console.ReadLine(); if (Surname.Trim() == "") { Console.Write("Поле \"Фамилия\" не может быть пустым. Введите его ещё раз."); } } break; case 2: Name = ""; while (Name.Trim() == "") { Console.Write("\nИмя*: "); Name = Console.ReadLine(); if (Name.Trim() == "") { Console.Write("Поле \"Имя\" не может быть пустым. Введите его ещё раз."); } } break; case 3: Console.Write("Отчество: "); SecondName = Console.ReadLine(); if (SecondName.Trim() == "") { SecondName = "Не указано"; } break; case 4: MobilePhone = ""; while (MobilePhone.Trim() == "") { Console.Write("\nНомер телефона (только цифры)*: "); MobilePhone = Console.ReadLine(); if (MobilePhone.Trim() == "") { Console.Write("Поле \"Номер телефона\" не может быть пустым. Введите его ещё раз."); } else if (!long.TryParse(MobilePhone, out long z)) { Console.Write("В поле \"Номер телефона\" могут содержаться только цифры. Введите его ещё раз."); MobilePhone = ""; } } break; case 5: Country = ""; while (Country.Trim() == "") { Console.Write("\nСтрана*: "); Country = Console.ReadLine(); if (Country.Trim() == "") { Console.Write("Поле \"Страна\" не может быть пустым. Введите его ещё раз. "); } } break; case 6: DateOfBirth = ""; Console.Write("\nДата рождения: "); DateOfBirth = Console.ReadLine(); if (DateOfBirth.Trim() != "") { while ((DateOfBirth.Trim() != "") && (!DateTime.TryParse(DateOfBirth, out DateTime z))) { Console.WriteLine("Дата записана в неверном формате. Запишите дату через точку в соответствии с форматом, установленным в вашей системе."); Console.Write("Например, 27.01.1970 . Вы по-прежнему можете оставить это поле пустым."); Console.Write("\nДата рождения:"); DateOfBirth = Console.ReadLine(); } } if (DateOfBirth.Trim() == "") { DateOfBirth = "Не указана"; } break; case 7: Console.Write("Организация: "); Organization = Console.ReadLine(); if (Organization.Trim() == "") { Organization = "Не указана"; } break; case 8: Console.Write("Должность: "); Appointment = Console.ReadLine(); if (Appointment.Trim() == "") { Appointment = "Не указана"; } break; case 9: Console.Write("Прочие заметки: "); if (OtherNotes.Trim() == "") { OtherNotes = "Заметок нет"; } OtherNotes = Console.ReadLine(); break; } }
/// <summary> /// Returns true if Owner instances are equal /// </summary> /// <param name="other">Instance of Owner to be compared</param> /// <returns>Boolean</returns> public bool Equals(Owner other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id.Equals(other.Id) ) && ( OwnerCode == other.OwnerCode || OwnerCode != null && OwnerCode.Equals(other.OwnerCode) ) && ( OrganizationName == other.OrganizationName || OrganizationName != null && OrganizationName.Equals(other.OrganizationName) ) && ( MeetsResidency == other.MeetsResidency || MeetsResidency.Equals(other.MeetsResidency) ) && ( LocalArea == other.LocalArea || LocalArea != null && LocalArea.Equals(other.LocalArea) ) && ( Status == other.Status || Status != null && Status.Equals(other.Status) ) && ( StatusComment == other.StatusComment || StatusComment != null && StatusComment.Equals(other.StatusComment) ) && ( DoingBusinessAs == other.DoingBusinessAs || DoingBusinessAs != null && DoingBusinessAs.Equals(other.DoingBusinessAs) ) && ( RegisteredCompanyNumber == other.RegisteredCompanyNumber || RegisteredCompanyNumber != null && RegisteredCompanyNumber.Equals(other.RegisteredCompanyNumber) ) && ( PrimaryContact == other.PrimaryContact || PrimaryContact != null && PrimaryContact.Equals(other.PrimaryContact) ) && ( IsMaintenanceContractor == other.IsMaintenanceContractor || IsMaintenanceContractor != null && IsMaintenanceContractor.Equals(other.IsMaintenanceContractor) ) && ( WorkSafeBCPolicyNumber == other.WorkSafeBCPolicyNumber || WorkSafeBCPolicyNumber != null && WorkSafeBCPolicyNumber.Equals(other.WorkSafeBCPolicyNumber) ) && ( WorkSafeBCExpiryDate == other.WorkSafeBCExpiryDate || WorkSafeBCExpiryDate != null && WorkSafeBCExpiryDate.Equals(other.WorkSafeBCExpiryDate) ) && ( GivenName == other.GivenName || GivenName != null && GivenName.Equals(other.GivenName) ) && ( Surname == other.Surname || Surname != null && Surname.Equals(other.Surname) ) && ( Address1 == other.Address1 || Address1 != null && Address1.Equals(other.Address1) ) && ( Address2 == other.Address2 || Address2 != null && Address2.Equals(other.Address2) ) && ( City == other.City || City != null && City.Equals(other.City) ) && ( Province == other.Province || Province != null && Province.Equals(other.Province) ) && ( PostalCode == other.PostalCode || PostalCode != null && PostalCode.Equals(other.PostalCode) ) && ( CGLEndDate == other.CGLEndDate || CGLEndDate != null && CGLEndDate.Equals(other.CGLEndDate) ) && ( CglPolicyNumber == other.CglPolicyNumber || CglPolicyNumber != null && CglPolicyNumber.Equals(other.CglPolicyNumber) ) && ( ArchiveCode == other.ArchiveCode || ArchiveCode != null && ArchiveCode.Equals(other.ArchiveCode) ) && ( ArchiveReason == other.ArchiveReason || ArchiveReason != null && ArchiveReason.Equals(other.ArchiveReason) ) && ( ArchiveDate == other.ArchiveDate || ArchiveDate != null && ArchiveDate.Equals(other.ArchiveDate) ) && ( Contacts == other.Contacts || Contacts != null && Contacts.SequenceEqual(other.Contacts) ) && ( Notes == other.Notes || Notes != null && Notes.SequenceEqual(other.Notes) ) && ( Attachments == other.Attachments || Attachments != null && Attachments.SequenceEqual(other.Attachments) ) && ( History == other.History || History != null && History.SequenceEqual(other.History) ) && ( EquipmentList == other.EquipmentList || EquipmentList != null && EquipmentList.SequenceEqual(other.EquipmentList) )); }
public override string ToString() { return(Name.ToString() + " " + Surname.ToString()); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks hash = hash * 59 + Id.GetHashCode(); if (OwnerCode != null) { hash = hash * 59 + OwnerCode.GetHashCode(); } if (OrganizationName != null) { hash = hash * 59 + OrganizationName.GetHashCode(); } hash = hash * 59 + MeetsResidency.GetHashCode(); if (LocalArea != null) { hash = hash * 59 + LocalArea.GetHashCode(); } if (Status != null) { hash = hash * 59 + Status.GetHashCode(); } if (StatusComment != null) { hash = hash * 59 + StatusComment.GetHashCode(); } if (DoingBusinessAs != null) { hash = hash * 59 + DoingBusinessAs.GetHashCode(); } if (RegisteredCompanyNumber != null) { hash = hash * 59 + RegisteredCompanyNumber.GetHashCode(); } if (PrimaryContact != null) { hash = hash * 59 + PrimaryContact.GetHashCode(); } if (IsMaintenanceContractor != null) { hash = hash * 59 + IsMaintenanceContractor.GetHashCode(); } if (WorkSafeBCPolicyNumber != null) { hash = hash * 59 + WorkSafeBCPolicyNumber.GetHashCode(); } if (WorkSafeBCExpiryDate != null) { hash = hash * 59 + WorkSafeBCExpiryDate.GetHashCode(); } if (GivenName != null) { hash = hash * 59 + GivenName.GetHashCode(); } if (Surname != null) { hash = hash * 59 + Surname.GetHashCode(); } if (Address1 != null) { hash = hash * 59 + Address1.GetHashCode(); } if (Address2 != null) { hash = hash * 59 + Address2.GetHashCode(); } if (City != null) { hash = hash * 59 + City.GetHashCode(); } if (Province != null) { hash = hash * 59 + Province.GetHashCode(); } if (PostalCode != null) { hash = hash * 59 + PostalCode.GetHashCode(); } if (CGLEndDate != null) { hash = hash * 59 + CGLEndDate.GetHashCode(); } if (CglPolicyNumber != null) { hash = hash * 59 + CglPolicyNumber.GetHashCode(); } if (ArchiveCode != null) { hash = hash * 59 + ArchiveCode.GetHashCode(); } if (ArchiveReason != null) { hash = hash * 59 + ArchiveReason.GetHashCode(); } if (ArchiveDate != null) { hash = hash * 59 + ArchiveDate.GetHashCode(); } if (Contacts != null) { hash = hash * 59 + Contacts.GetHashCode(); } if (Notes != null) { hash = hash * 59 + Notes.GetHashCode(); } if (Attachments != null) { hash = hash * 59 + Attachments.GetHashCode(); } if (History != null) { hash = hash * 59 + History.GetHashCode(); } if (EquipmentList != null) { hash = hash * 59 + EquipmentList.GetHashCode(); } return(hash); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks hash = hash * 59 + Id.GetHashCode(); if (GivenName != null) { hash = hash * 59 + GivenName.GetHashCode(); } if (Surname != null) { hash = hash * 59 + Surname.GetHashCode(); } hash = hash * 59 + Active.GetHashCode(); if (Initials != null) { hash = hash * 59 + Initials.GetHashCode(); } if (Email != null) { hash = hash * 59 + Email.GetHashCode(); } if (SmUserId != null) { hash = hash * 59 + SmUserId.GetHashCode(); } if (Guid != null) { hash = hash * 59 + Guid.GetHashCode(); } if (SmAuthorizationDirectory != null) { hash = hash * 59 + SmAuthorizationDirectory.GetHashCode(); } if (UserRoles != null) { hash = hash * 59 + UserRoles.GetHashCode(); } if (District != null) { hash = hash * 59 + District.GetHashCode(); } if (UserDistricts != null) { hash = hash * 59 + UserDistricts.GetHashCode(); } return(hash); } }
private void PrepareName() { this.Surname = Surname.GetUnifiedName(); this.Name = Name.GetUnifiedName(); }
/// <summary> /// Returns the hash code of a PlayerStatistics object /// </summary> /// <returns>hash code of the a object</returns> public override int GetHashCode() { return(Team.GetHashCode() | Name.GetHashCode() | Surname.GetHashCode() | MinutesPlayed.GetHashCode() | PointsScored.GetHashCode() | FoulsMade.GetHashCode()); }
public bool HasAllNonEmpty() { return(!Name.IsNullOrEmpty() && !Surname.IsNullOrEmpty() && !EmailAddress.IsNullOrEmpty()); }
public override string ToString() { return(String.Format($"{Surname.ToUpper()}, {FirstName} - Part Time ")); }
public override string Print() { return($"Name: {Firstname.PadRight(9)} | Surname: {Surname.PadRight(9)} | Age: {Age} | Specialty: {Specialty}"); }
private static Boolean KawigiEdit_RunTest(int testNum, string[] p0, Boolean hasAnswer, int p1) { Console.Write("Test " + testNum + ": [" + "{"); for (int i = 0; p0.Length > i; ++i) { if (i > 0) { Console.Write(","); } Console.Write("\"" + p0[i] + "\""); } Console.Write("}"); Console.WriteLine("]"); Surname obj; int answer; obj = new Surname(); DateTime startTime = DateTime.Now; answer = obj.bestSurname(p0); DateTime endTime = DateTime.Now; Boolean res; res = true; Console.WriteLine("Time: " + (endTime - startTime).TotalSeconds + " seconds"); if (hasAnswer) { Console.WriteLine("Desired answer:"); Console.WriteLine("\t" + p1); } Console.WriteLine("Your answer:"); Console.WriteLine("\t" + answer); if (hasAnswer) { res = answer == p1; } if (!res) { Console.WriteLine("DOESN'T MATCH!!!!"); } else if ((endTime - startTime).TotalSeconds >= 2) { Console.WriteLine("FAIL the timeout"); res = false; } else if (hasAnswer) { Console.WriteLine("Match :-)"); } else { Console.WriteLine("OK, but is it right?"); } Console.WriteLine(""); return res; }
public bool Contains(string str) { return(Name.ToUpper().Contains(str) || Surname.ToUpper().Contains(str) || Id.ToString().Contains(str) || Email.ToUpper().ToString().Contains(str)); }