dev
This commit is contained in:
@@ -35,6 +35,6 @@ namespace ZpcBulletinBoard.Models.Editor
|
||||
|
||||
// InvoicePart
|
||||
[InverseProperty("BulletinBoard")]
|
||||
public virtual ICollection<BulletinBoardPage> Pages { get; set; }
|
||||
public virtual ICollection<BulletinBoardPageLink> Links { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,46 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using ZpcBulletinBoard.Classes;
|
||||
using static ZpcBulletinBoard.Models.Editor.BulletinBoard;
|
||||
|
||||
namespace ZpcBulletinBoard.Models.Editor
|
||||
{
|
||||
public class BulletinBoardPage
|
||||
{
|
||||
|
||||
public enum TypeEnum
|
||||
{
|
||||
[Display(Name = "Deska")]
|
||||
Board = 1,
|
||||
[Display(Name = "Slika")]
|
||||
Image = 2,
|
||||
[Display(Name = "Zunanja povezava")]
|
||||
ExternalLink = 3
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int IdBulletinBoardPage { get; set; }
|
||||
|
||||
[Required]
|
||||
[ForeignKey("BulletinBoard")]
|
||||
public int IdBulletinBoard { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Ime")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Trajanje")]
|
||||
public int Duration { get; set; }
|
||||
[Display(Name = "Razmerje")]
|
||||
public RatioEnum Ratio { get; set; }
|
||||
|
||||
// ForeignKey
|
||||
public BulletinBoard BulletinBoard { get; set; }
|
||||
[NotMapped]
|
||||
public string RatioString => Ratio.GetAttributeOfType<DisplayAttribute>().Name ?? "";
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Tip")]
|
||||
public TypeEnum Type { get; set; }
|
||||
|
||||
public string? Image { get; set; }
|
||||
public string? ExternalLink { get; set; }
|
||||
|
||||
[InverseProperty("BulletinBoardPage")]
|
||||
public virtual ICollection<BulletinBoardPageLink> Links { get; set; }
|
||||
|
||||
[InverseProperty("BulletinBoardPage")]
|
||||
public virtual ICollection<Note> Notes { get; set; }
|
||||
|
||||
30
ZpcBulletinBoard/Models/Editor/BulletinBoardPageLink.cs
Normal file
30
ZpcBulletinBoard/Models/Editor/BulletinBoardPageLink.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace ZpcBulletinBoard.Models.Editor
|
||||
{
|
||||
public class BulletinBoardPageLink
|
||||
{
|
||||
[Key]
|
||||
public int IdLink { get; set; }
|
||||
|
||||
[Required]
|
||||
[ForeignKey("BulletinBoard")]
|
||||
public int IdBulletinBoardFk { get; set; }
|
||||
[Required]
|
||||
[ForeignKey("BulletinBoardPage")]
|
||||
public int IdBulletinBoardPageFk { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Trajanje")]
|
||||
public int Duration { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Vrstni red")]
|
||||
public int Order { get; set; }
|
||||
|
||||
// ForeignKey
|
||||
public BulletinBoard BulletinBoard { get; set; }
|
||||
public BulletinBoardPage BulletinBoardPage { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,13 @@ namespace ZpcBulletinBoard.Models.Editor
|
||||
{
|
||||
public class Note
|
||||
{
|
||||
public enum TypeEnum
|
||||
{
|
||||
Board = 1,
|
||||
Image = 2,
|
||||
ExternalLink = 3
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int IdNote { get; set; }
|
||||
|
||||
@@ -33,6 +40,9 @@ namespace ZpcBulletinBoard.Models.Editor
|
||||
[Required]
|
||||
public string ColorClass { get; set; }
|
||||
|
||||
[Required]
|
||||
public TypeEnum Type { get; set; }
|
||||
|
||||
// ForeignKey
|
||||
public BulletinBoardPage BulletinBoardPage { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user