Neuerstellung
This commit is contained in:
48
scr/FSI.BT.IR.Organization.Db/Models/Organization.cs
Normal file
48
scr/FSI.BT.IR.Organization.Db/Models/Organization.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace FSI.BT.IR.Organization.Db.Models
|
||||
{
|
||||
public class Organization
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[DisplayName("Bezeichnung")]
|
||||
[Required(ErrorMessage = "Pflichtfeld")]
|
||||
[StringLength(64)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[DisplayName("Kurzname")]
|
||||
[Required(ErrorMessage = "Pflichtfeld")]
|
||||
[StringLength(16)]
|
||||
public string ShortName { get; set; }
|
||||
|
||||
[DisplayName("Beschreibung")]
|
||||
[StringLength(128)]
|
||||
public string? Description { get; set; }
|
||||
|
||||
[DisplayName("Übergeordnetes Objekt")]
|
||||
public int? ParentId { get; set; }
|
||||
|
||||
[DisplayName("Typ")]
|
||||
[Required(ErrorMessage = "Pflichtfeld")]
|
||||
public OrganizationType Type { get; set; }
|
||||
|
||||
[DisplayName("Erstellungsdatum")]
|
||||
[Required(ErrorMessage = "Pflichtfeld")]
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
[DisplayName("Bearbeitungsdatum")]
|
||||
[Required(ErrorMessage = "Pflichtfeld")]
|
||||
public DateTime Updated { get; set; }
|
||||
|
||||
[DisplayName("Bereich")]
|
||||
public string FullShortName { get; set; }
|
||||
|
||||
|
||||
public virtual Organization? Parent { get; set; }
|
||||
public virtual ICollection<Organization> Parents { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
18
scr/FSI.BT.IR.Organization.Db/Models/OrganizationType.cs
Normal file
18
scr/FSI.BT.IR.Organization.Db/Models/OrganizationType.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace FSI.BT.IR.Organization.Db.Models
|
||||
{
|
||||
public enum OrganizationType
|
||||
{
|
||||
[Display(Name = "Firma")]
|
||||
company,
|
||||
[Display(Name = "Werk")]
|
||||
factory,
|
||||
[Display(Name = "Bereich")]
|
||||
area,
|
||||
[Display(Name = "Anlage")]
|
||||
plant,
|
||||
[Display(Name = "Teilanlage")]
|
||||
subPlant,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user