70 lines
1.9 KiB
C#
70 lines
1.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace EveryThing.Models.Project
|
|
{
|
|
public enum ProjectPartStatus
|
|
{
|
|
[Display(Name = "Odprto")]
|
|
Opened = 0,
|
|
|
|
[Display(Name = "V izdelavi")]
|
|
InProduction = 1,
|
|
|
|
[Display(Name = "Zaključeno")]
|
|
Finished = 2,
|
|
|
|
[Display(Name = "Odpremljeno")]
|
|
Shipped = 3
|
|
}
|
|
|
|
public class ProjectPart
|
|
{
|
|
[Key]
|
|
public int IdProjectPart { get; set; }
|
|
|
|
[Required]
|
|
[ForeignKey("Project")]
|
|
public int IdProjectFk { get; set; }
|
|
|
|
[Required]
|
|
[Display(Name = "Naziv")]
|
|
public string Title { get; set; }
|
|
|
|
[Display(Name = "Opis")]
|
|
public string Description { get; set; }
|
|
|
|
[Required]
|
|
[Display(Name = "Status")]
|
|
public ProjectPartStatus Status { get; set; } = ProjectPartStatus.Opened;
|
|
|
|
[Display(Name = "Datum zaključka")]
|
|
[DisplayFormat(DataFormatString = "{0:dd.MM.yyyy}", ApplyFormatInEditMode = true)]
|
|
public DateTime? FinishedDate { get; set; }
|
|
|
|
[Display(Name = "Datum odpreme")]
|
|
[DisplayFormat(DataFormatString = "{0:dd.MM.yyyy}", ApplyFormatInEditMode = true)]
|
|
public DateTime? ShippedDate { get; set; }
|
|
|
|
[Display(Name = "Pot načrtov")]
|
|
public string PathOfPlans { get; set; }
|
|
|
|
[Required]
|
|
public int ProjectPartNumber { get; set; } = 0;
|
|
|
|
[NotMapped]
|
|
public string ProjectPartNumberFormatted => (Project != null ? Project.ProjectNumberFormatted : "") + $"-{ProjectPartNumber:D4}";
|
|
|
|
// ForeignKey
|
|
public Project Project { get; set; }
|
|
|
|
// ProjectPartItem
|
|
[InverseProperty("ProjectPart")]
|
|
public virtual ICollection<ProjectPartItem> ProjectPartProjectPartItem { get; set; }
|
|
}
|
|
}
|