Beispiel #1
0
        public void ReplaceInvalidText()
        {
            if (IsValidArticle())
            {
                return;
            }

            if (Title == null || Title.Equals("exception"))
            {
                Title = "<i>nema naslova</i>";
            }

            if (Lead == null || Lead.Equals("exception"))
            {
                Lead = "<i>nema podnaslova</i>";
            }

            if (Author == null || Author.Equals("exception"))
            {
                Author = "<i>nema autora</i>";
            }

            if (Time == null || Time.Equals("exception"))
            {
                Time = "<i>nema vremena objave</i>";
            }

            if (Content == null || Content.Equals("exception"))
            {
                Content = "<i>nema sadržaja</i>";
            }
        }
Beispiel #2
0
 public bool IsValidArticle()
 {
     if (Title != null && !Title.Equals("exception") &&
         Lead != null && !Lead.Equals("exception") &&
         Author != null && !Author.Equals("exception") &&
         Time != null && !Time.Equals("exception") &&
         Content != null && !Content.Equals("exception"))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }