Prvi commit

This commit is contained in:
David Štaleker
2023-05-12 09:00:07 +02:00
parent d3ffe93e42
commit 03b92525d7
14757 changed files with 9251133 additions and 53 deletions

View File

@@ -0,0 +1,69 @@
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; }
}
}