public bool Equals(Student item) { var result = true; result &= (SerialNumber == item.SerialNumber); result &= (Name.Equals(item.Name)); result &= (BornDate.Equals(item.BornDate)); result &= (Country.Equals(item.Country)); return(result); }
public bool Equals(Author item) { var result = true; result &= (Id == item.Id); result &= (Name.Equals(item.Name)); result &= (Surname.Equals(item.Surname)); result &= (BornDate.Equals(item.BornDate)); result &= (Country.Equals(item.Country)); return(result); }
public string ShowInfo(ShowType type = ShowType.Table) { switch (type) { case ShowType.Table: return(string.Format("|{0,6} |{1,15} |{2,15} |{3,15} |", Id, LastName, FirstName, Phone)); case ShowType.Canvas: string result = string.Format("{0,-15} {1}\n", "Фамилия:", LastName); result += string.Format("{0,-15} {1}\n", "Имя:", FirstName); result += string.Format("{0,-15} {1}\n", "Отчество:", MiddName); result += string.Format("{0,-15} {1}\n", "Дата рождения:", BornDate.ToString("dd.MM.yyyy")); result += string.Format("{0,-15} {1}\n", "Страна:", Country); result += string.Format("{0,-15} {1}\n", "Телефон:", Phone); result += string.Format("{0,-15} {1}\n", "Должность:", Post); result += string.Format("{0,-15} {1}\n", "Организация:", Club); result += string.Format("{0,-15} {1}\n", "Описание:", Other); return(result); default: return(ToString()); } }
public override string ToString() { return(string.Format("{3} >>> Hey! My name is {0} and I {1} {2}", Name, IsBornDateExact ? "was born on" : "will born around", BornDate.ToShortDateString(), Sex.GetDBValue())); }