Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public static List <Article> GetBySearch(string S)
 {
     NewsEntity.Repositories.ArticleRepository repo = new Repositories.ArticleRepository();
     return(repo.GetBySearch(S));
 }
Exemplo n.º 3
0
 public static List <Article> GetDisplayed(int Category)
 {
     NewsEntity.Repositories.ArticleRepository repo = new Repositories.ArticleRepository();
     return(repo.GetDisplayed(Category));
 }
Exemplo n.º 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));
 }
Exemplo n.º 5
0
 public static List <Article> GetPublished()
 {
     NewsEntity.Repositories.ArticleRepository repo = new Repositories.ArticleRepository();
     return(repo.GetPublished());
 }
Exemplo n.º 6
0
 public static Article GetBySource(string Source)
 {
     NewsEntity.Repositories.ArticleRepository repo = new Repositories.ArticleRepository();
     return(repo.GetBySource(Source));
 }
Exemplo n.º 7
0
 public static Article GetById(int ID)
 {
     Common.IRepository <Article> repo = new Repositories.ArticleRepository();
     return(repo.GetById(ID));
 }
Exemplo n.º 8
0
 public static List <Article> GetAll()
 {
     Common.IRepository <Article> repo = new Repositories.ArticleRepository();
     return(repo.GetAll());
 }
Exemplo n.º 9
0
        public virtual void Delete()
        {
            Common.IRepository <Article> repo = new Repositories.ArticleRepository();

            repo.Delete(this);
        }