Files
marechai/Marechai.Database/Models/Company.cs

100 lines
4.6 KiB
C#
Raw Normal View History

2018-08-07 20:06:44 +01:00
/******************************************************************************
2020-02-10 01:52:56 +00:00
// MARECHAI: Master repository of computing history artifacts information
2018-08-07 20:06:44 +01:00
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
2020-02-10 03:05:39 +00:00
// Copyright © 2003-2020 Natalia Portillo
2018-08-07 20:06:44 +01:00
*******************************************************************************/
using System;
2018-08-06 21:27:14 +01:00
using System.Collections.Generic;
2019-05-18 11:19:06 +01:00
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
2018-08-07 21:47:29 +01:00
using System.Linq;
2018-08-06 21:27:14 +01:00
2020-02-10 02:10:18 +00:00
namespace Marechai.Database.Models
2018-08-06 21:27:14 +01:00
{
2019-05-19 17:51:28 +01:00
public class Company : BaseModel<int>
2018-08-06 21:27:14 +01:00
{
public Company()
{
2018-08-07 21:47:29 +01:00
Logos = new HashSet<CompanyLogo>();
2018-08-06 21:27:14 +01:00
Gpus = new HashSet<Gpu>();
InverseSoldToNavigation = new HashSet<Company>();
MachineFamilies = new HashSet<MachineFamily>();
Machines = new HashSet<Machine>();
Processors = new HashSet<Processor>();
SoundSynths = new HashSet<SoundSynth>();
}
2019-05-19 18:35:28 +01:00
[Required]
2019-05-18 11:19:06 +01:00
public string Name { get; set; }
2020-02-10 22:44:18 +00:00
[DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true), DataType(DataType.Date)]
2019-05-19 18:35:28 +01:00
public DateTime? Founded { get; set; }
2020-02-10 22:44:18 +00:00
[Url, StringLength(255)]
2019-05-19 18:35:28 +01:00
public string Website { get; set; }
[StringLength(45)]
public string Twitter { get; set; }
[StringLength(45)]
public string Facebook { get; set; }
2020-02-10 22:44:18 +00:00
[DisplayFormat(DataFormatString = "{0:d}"), DataType(DataType.Date)]
2019-05-19 18:35:28 +01:00
public DateTime? Sold { get; set; }
public int? SoldToId { get; set; }
[StringLength(80)]
public string Address { get; set; }
[StringLength(80)]
public string City { get; set; }
[StringLength(80)]
public string Province { get; set; }
2020-02-10 22:44:18 +00:00
[StringLength(25), DisplayName("Postal code")]
2019-05-19 18:35:28 +01:00
public string PostalCode { get; set; }
public short? CountryId { get; set; }
[Required]
2019-06-17 00:42:45 +01:00
public CompanyStatus Status { get; set; }
public int? DocumentCompanyId { get; set; }
[DefaultValue(false)]
public bool FoundedMonthIsUnknown { get; set; }
[DefaultValue(false)]
public bool FoundedDayIsUnknown { get; set; }
[DefaultValue(false)]
public bool SoldMonthIsUnknown { get; set; }
[DefaultValue(false)]
public bool SoldDayIsUnknown { get; set; }
2020-08-06 01:40:39 +01:00
public string LegalName { get; set; }
2018-08-06 21:27:14 +01:00
2019-05-18 11:19:06 +01:00
public virtual Iso31661Numeric Country { get; set; }
[DisplayName("Sold to")]
2020-06-01 02:12:50 +01:00
public virtual Company SoldTo { get; set; }
public virtual ICollection<CompanyDescription> Descriptions { get; set; }
public virtual ICollection<CompanyLogo> Logos { get; set; }
public virtual ICollection<Gpu> Gpus { get; set; }
public virtual ICollection<Company> InverseSoldToNavigation { get; set; }
public virtual ICollection<MachineFamily> MachineFamilies { get; set; }
public virtual ICollection<Machine> Machines { get; set; }
public virtual ICollection<Processor> Processors { get; set; }
public virtual ICollection<SoundSynth> SoundSynths { get; set; }
public virtual ICollection<PeopleByCompany> People { get; set; }
public virtual CompanyLogo LastLogo => Logos?.OrderByDescending(l => l.Year).FirstOrDefault();
2019-06-17 00:42:45 +01:00
public virtual DocumentCompany DocumentCompany { get; set; }
2020-06-11 18:51:58 +01:00
public virtual ICollection<CompaniesBySoftwareFamily> SoftwareFamilies { get; set; }
2020-06-11 19:10:13 +01:00
public virtual ICollection<CompaniesBySoftwareVersion> SoftwareVersions { get; set; }
2020-06-11 22:51:48 +01:00
public virtual ICollection<CompaniesBySoftwareVariant> SoftwareVariants { get; set; }
2018-08-06 21:27:14 +01:00
}
}