Example #1
0
        public virtual void Update()
        {
            this.updated_at = DateTime.Now;
            Common.IRepository <Article> repo = new Repositories.ArticleRepository();

            if (this.Published_At.HasValue == true)
            {
                this.Displayed_At = (DateTime)this.Published_At.Value.AddDays(this.Displayed_Days);
            }

            repo.Update(this);
        }
Example #2
0
 public static List <Article> GetBySearch(string S)
 {
     NewsEntity.Repositories.ArticleRepository repo = new Repositories.ArticleRepository();
     return(repo.GetBySearch(S));
 }
Example #3
0
 public static List <Article> GetDisplayed(int Category)
 {
     NewsEntity.Repositories.ArticleRepository repo = new Repositories.ArticleRepository();
     return(repo.GetDisplayed(Category));
 }
Example #4
0
 public static List <Article> GetByCategory(int Category, int offset = 0, int max = -1, int recent_days = 0)
 {
     NewsEntity.Repositories.ArticleRepository repo = new Repositories.ArticleRepository();
     return(repo.GetByCategory(Category, offset, max, recent_days));
 }
Example #5
0
 public static List <Article> GetPublished()
 {
     NewsEntity.Repositories.ArticleRepository repo = new Repositories.ArticleRepository();
     return(repo.GetPublished());
 }
Example #6
0
 public static Article GetBySource(string Source)
 {
     NewsEntity.Repositories.ArticleRepository repo = new Repositories.ArticleRepository();
     return(repo.GetBySource(Source));
 }
Example #7
0
 public static Article GetById(int ID)
 {
     Common.IRepository <Article> repo = new Repositories.ArticleRepository();
     return(repo.GetById(ID));
 }
Example #8
0
 public static List <Article> GetAll()
 {
     Common.IRepository <Article> repo = new Repositories.ArticleRepository();
     return(repo.GetAll());
 }
Example #9
0
        public virtual void Delete()
        {
            Common.IRepository <Article> repo = new Repositories.ArticleRepository();

            repo.Delete(this);
        }