Prvi commit
This commit is contained in:
56
EveryThing/Models/CodeTable/CodeTableItem.cs
Normal file
56
EveryThing/Models/CodeTable/CodeTableItem.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using EveryThing.Models.Project;
|
||||
|
||||
namespace EveryThing.Models.CodeTable
|
||||
{
|
||||
public enum CodeTableItemType
|
||||
{
|
||||
[Display(Name = "Produkt")]
|
||||
Product = 0,
|
||||
|
||||
[Display(Name = "Material")]
|
||||
Material = 1
|
||||
}
|
||||
public class CodeTableItem
|
||||
{
|
||||
[Key]
|
||||
public int IdItem { get; set; }
|
||||
|
||||
[Required]
|
||||
[ForeignKey("Company")]
|
||||
public int IdCompanyFk { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Naziv")]
|
||||
public string Title { get; set; }
|
||||
|
||||
[Display(Name = "Opis")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Aktiven")]
|
||||
public bool Active { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Tip")]
|
||||
public CodeTableItemType CodeTableItemType { get; set; } = CodeTableItemType.Product;
|
||||
|
||||
// ForeignKey
|
||||
public CodeTableCompany Company { get; set; }
|
||||
|
||||
// ProjectPartItem
|
||||
[InverseProperty("Item")]
|
||||
public virtual ICollection<ProjectPartItem> ItemProjectPartItem { get; set; }
|
||||
|
||||
// ProjectPartItem
|
||||
[InverseProperty("Material")]
|
||||
public virtual ICollection<ProjectPartItem> ItemProjectPartItemMaterial { get; set; }
|
||||
|
||||
// InoviceItem
|
||||
[InverseProperty("Item")]
|
||||
public virtual ICollection<Invoice.InvoiceItem> InvoiceItem { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user