diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/QuoteDTO.cs b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteDTO.cs index 532e700..d2f3a58 100644 --- a/WF-WebAdmin/WF-WebAdmin/Converter/QuoteDTO.cs +++ b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteDTO.cs @@ -5,14 +5,55 @@ namespace WF_WebAdmin.Converter { public class QuoteDTO { - private int id_quote; - private string content; - private int likes; - private string langue; - private bool isValide; - private string? reason; - private int id_caracter; - private int id_source; - private int? id_user_verif; + public int Id { get; set; } + public string Content { get; set; } + public int Likes { get; set; } + public string Langue { get; set; } + public bool IsValide { get; set; } + public string? Reason { get; set; } + public int IdCaracter { get; set; } + public int IdSource { get; set; } + public int? IdUserVerif { get; set; } + + public QuoteDTO(int id_quote, string content, int likes, string langue, bool isValide, string? reason, int id_caracter, int id_source, int? id_user_verif) + { + this.Id = id_quote; + } + + public int getId_quote() + { + return id_quote; + } + public string getContent() { + return content; + } + public int getLikes() + { + return likes; + } + public string getLangue() + { + return langue; + } + public bool getIsValide() + { + return isValide; + } + public string? getReason() + { + return reason; + } + public int getIdCaracter() + { + return id_caracter; + } + public int getIdSource() + { + return id_source; + } + public int? getIdUserVerif() + { + return id_user_verif; + } } } diff --git a/WF-WebAdmin/WF-WebAdmin/Converter/QuoteExtension.cs b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteExtension.cs index a449430..c3401f3 100644 --- a/WF-WebAdmin/WF-WebAdmin/Converter/QuoteExtension.cs +++ b/WF-WebAdmin/WF-WebAdmin/Converter/QuoteExtension.cs @@ -1,7 +1,19 @@ -namespace WF_WebAdmin.Converter +using WF_WebAdmin.Model; + +namespace WF_WebAdmin.Converter { public class QuoteExtension { + public QuoteDTO QuoteToDTO(Quote q) + { + QuoteDTO quote = new QuoteDTO(q.Id, q.Content, q.Likes, q.Langue, q.IsValide, q.Reason, q.IdCaracter, q.IdSource, q.IdUserVerif); + return quote; + } + public Quote DTOToQuote(QuoteDTO q) + { + Quote quote = new Quote(); + return quote; + } } } diff --git a/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs b/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs index 53a25b2..4e3d711 100644 --- a/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs +++ b/WF-WebAdmin/WF-WebAdmin/Model/Quote.cs @@ -10,6 +10,19 @@ public string? Reason { get; set; } public int IdCaracter { get; set; } public int IdSource { get; set; } - public int IdUserVerif { get; set; } + public int? IdUserVerif { get; set; } + + public Quote(int id, string content, int likes, string langue, bool isValide, string? reason, int idCaracter, int idSource, int idUserVerif) + { + Id = id; + Content = content; + Likes = likes; + Langue = langue; + IsValide = isValide; + Reason = reason; + IdCaracter = idCaracter; + IdSource = idSource; + IdUserVerif = idUserVerif; + } } }