예제 #1
0
        //-------------------

        //Update News
        public void UpdateNews(string id, string title, string content, Boolean active)
        {
            tbl_New news = db_OBTRS.tbl_News.Single(udt => udt.News_ID.Equals((Object)id));

            news.News_Title   = title;
            news.News_Content = content;
            news.News_Active  = active;
            news.News_Edit    = DateTime.Now;
            db_OBTRS.SubmitChanges();
        }
예제 #2
0
        //Them tin tuc moi
        public void AddNews(String tittle, String content, Boolean active)
        {
            tbl_New news = new tbl_New();

            news.News_Title   = tittle;
            news.News_Content = content;
            news.News_Active  = active;
            //Thong tin khac
            news.News_Release = DateTime.Now;
            news.News_Edit    = DateTime.Now;
            news.News_ID      = Guid.NewGuid();
            db_OBTRS.tbl_News.InsertOnSubmit(news);
            db_OBTRS.SubmitChanges();
        }
예제 #3
0
파일: News.cs 프로젝트: abdul-baten/hbcms
        /// <summary>
        /// Insert news
        /// </summary>
        /// <param name="CategoryId"></param>
        /// <param name="IsApproved"></param>
        /// <param name="IsFeatured"></param>
        /// <returns></returns>
        public static Guid InsertNews(int CategoryId,bool IsApproved, bool IsFeatured)
        {
            tbl_New _NewsObj = new tbl_New();
            _NewsObj.CategoryId = CategoryId;
            _NewsObj.DateCreate = DateTime.Now;
            _NewsObj.IsApproved = IsApproved;
            _NewsObj.IsFeatured = IsFeatured;

            try
            {
                Enidc.Web.DataHelper.Insert<tbl_New>(_NewsObj);
                return _NewsObj.NewsId;
            }
            catch(Exception ex)
            {
                //return new Guid();
                throw new Exception(ex.ToString());
            }
        }
예제 #4
0
파일: News.cs 프로젝트: abdul-baten/hbcms
        /// <summary>
        /// 
        /// </summary>
        /// <param name="NewsId"></param>
        /// <returns></returns>
        public static tbl_New GetNewsById(Guid NewsId)
        {
            tbl_New _OneNews = new tbl_New();
               using (enidcDataContext db = Enidc.Web.DataHelper.getEnIdcData())
               {
               try
               {
                   _OneNews = db.tbl_News.Where(i => i.NewsId.Equals(NewsId)).SingleOrDefault();
               }
               catch { }

               }
               return _OneNews;
        }
예제 #5
0
 partial void Deletetbl_New(tbl_New instance);
예제 #6
0
 partial void Updatetbl_New(tbl_New instance);
예제 #7
0
 partial void Inserttbl_New(tbl_New instance);
예제 #8
0
	private void detach_tbl_News(tbl_New entity)
	{
		this.SendPropertyChanging();
		entity.tbl_Category = null;
	}