Beispiel #1
0
 public PostareViewModel(string t, string top, TipPostare tip, GradImportantaPostare grad, string b)
 {
     Titlu           = t;
     Topic           = top;
     Tip             = tip;
     NivelImportanta = grad;
     Body            = b;
 }
Beispiel #2
0
 public Postare(PlainText titlu, PlainText autor, PlainText body, PlainText topic,
                GradImportantaPostare grad, TipPostare tip, DateTime d)
 {
     _comentarii     = new List <Comentariu>();
     Titlu           = titlu;
     Autor           = autor;
     Body            = body;
     Topic           = topic;
     NivelImportanta = grad;
     Tip             = tip;
     DataPostarii    = new DateTime();
     DataPostarii    = DateTime.Now;
     _comentarii     = null;
 }
 public Postare CreeazaPostare(string titlu, string autor, string body, string topic, GradImportantaPostare grad,
                               TipPostare tip, DateTime d)
 {
     if ((int)tip > 2 || (int)grad > 2)
     {
         throw new GradSauTipIntroduseGresitException();
     }
     else
     {
         var postare = new Postare(new PlainText(titlu), new PlainText(autor),
                                   new PlainText(body), new PlainText(topic), grad,
                                   tip, d);
         return(postare);
     }
 }