Beispiel #1
0
		public BENews SelectAll()
		{
			BENews ds = new BENews();
			DANews da = new DANews();
			da.SelectAll(ds.tbl_News);
			return ds;
		}
Beispiel #2
0
 public BENews SelectAllInactive()
 {
     BENews ds = new BENews();
     DANewsTypes da = new DANewsTypes();
     da.SelectAllInactive(ds.tbl_NewsTypes);
     return ds;
 }
Beispiel #3
0
        public BENews SelectByNewsTypeName(string NewsTypeName)
        {
            BENews ds = new BENews();
            DANewsTypes da = new DANewsTypes();

            da.SelectByNewsTypeName(NewsTypeName, ds.tbl_NewsTypes);
            return ds;
        }
Beispiel #4
0
        public BENews SelectNewsTypeByID(int NewsTypeID)
        {
            BENews ds = new BENews();
            DANewsTypes da = new DANewsTypes();

            da.SelectByID(NewsTypeID.ToString(), ds.tbl_NewsTypes);
            return ds;
        }
Beispiel #5
0
        public BENews SelectActiveByNewsTypeID(int NewsTypeID)
        {
            BENews ds = new BENews();
            DANews da = new DANews();

            da.SelectActiveByNewsTypeID(NewsTypeID, ds.tbl_News);
            return ds;
        }
Beispiel #6
0
        public BENews SelectActiveByIDWithROColumns(int newsID)
        {
            BENews ds = new BENews();
            DANews da = new DANews();

            da.SelectActiveByIDWithROColumns(newsID, ds.tbl_News);
            return ds;
        }
Beispiel #7
0
		public BENews SelectByID(int newsID)
		{
			BENews ds = new BENews();
			DANews da = new DANews();

			da.SelectByID(newsID.ToString(), ds.tbl_News);
			return ds;
		}
Beispiel #8
0
        private void BindTitle()
        {
            BPNewsTypes bp = new BPNewsTypes();
            DSNews = bp.SelectNewsTypeByID(SubTypeID);

            if (DSNews.tbl_NewsTypes.Count > 0)
            {
                BENews.tbl_NewsTypesRow typeRow = DSNews.tbl_NewsTypes[0];
                lblTitle.Text = "Browse " + typeRow.NewsTypeName + "s";
                btnAdd.Text = "Add New";
            }
        }
Beispiel #9
0
 public void Update(BENews ds)
 {
     DANewsTypes da = new DANewsTypes();
     da.Update(ds.tbl_NewsTypes);
 }
Beispiel #10
0
 public BENews SelectFeaturedFR()
 {
     BENews ds = new BENews();
     DANews da = new DANews();
     da.SelectFeaturedFR(ds.tbl_News);
     return ds;
 }
Beispiel #11
0
        public BENews SelectRecentNewsItemsWithROColumns()
        {
            BENews ds = new BENews();
            DANews da = new DANews();

            da.SelectRecentNewsItemsWithROColumns(ds.tbl_News);
            return ds;
        }
Beispiel #12
0
        private void SaveNewsInfo()
        {
            bool isNew = false;
            BPNews bp = new BPNews();
            BENews dsNews = new BENews();
            BENews.tbl_NewsRow news = null;

            //int tempImageID1 = 0;

            if (NewsID > 0)
            {
                dsNews = bp.SelectByID(NewsID);
                news = dsNews.tbl_News.FindByNewsID(NewsID);

                //if (!news.IsNewsImage1Null())
                //    tempImageID1 = news.NewsImage1;
            }

            if (news == null)
            {
                news = dsNews.tbl_News.Newtbl_NewsRow();
                isNew = true;
            }

            news.NewsTitle = txtNewsTitle.Text.Trim();

            if (txtNewsTitleFR.Text.Trim() != "")
                news.NewsTitleFR = txtNewsTitleFR.Text.Trim();
            else
                news.SetNewsTitleFRNull();

            if (dtNewsDate.Date != dtNewsDate.MinDate)
                news.NewsDate = dtNewsDate.Date;
            else
                news.SetNewsDateNull();

            if (txtNewsDescription.Text.Trim() != "")
                news.NewsDescription = txtNewsDescription.Text.Trim();
            else
                news.SetNewsDescriptionNull();

            if (txtNewsDescriptionFR.Text.Trim() != "")
                news.NewsDescriptionFR = txtNewsDescriptionFR.Text.Trim();
            else
                news.SetNewsDescriptionFRNull();

            if (docNewsDocument.SelectedDocument > 0)
                news.NewsDocumentID = docNewsDocument.SelectedDocument;
            else
                news.SetNewsDocumentIDNull();

            if (docNewsDocumentFR.SelectedDocument > 0)
                news.NewsDocumentIDFR = docNewsDocumentFR.SelectedDocument;
            else
                news.SetNewsDocumentIDFRNull();

            //if (txtNewsTime.Text.Trim() != "")
            //    news.NewsTime = txtNewsTime.Text.Trim();
            //else
            //    news.SetNewsTimeNull();

            //if (txtNewsLocation.Text.Trim() != "")
            //    news.NewsLocation = txtNewsLocation.Text.Trim();
            //else
            //    news.SetNewsLocationNull();

            //if (txtNewsMapInfo.Text.Trim() != "")
            //    news.NewsMapInfo = txtNewsMapInfo.Text.Trim();
            //else
            //    news.SetNewsMapInfoNull();

            //if (edtNewsContent.Text.Trim() == "")
            //    news.SetNewsDescriptionNull();
            //else
            //    news.NewsDescription = edtNewsContent.Text.Trim();

            //if (imgNewsImage1.SelectedImage > 0)
            //{
            //    news.NewsImage1 = imgNewsImage1.SelectedImage;
            //    news.NewsImage1Alignment = Convert.ToInt32(ddlNewsImage1Alignment.SelectedValue);
            //}
            //else
            //{
            //    news.SetNewsImage1Null();
            //    news.SetNewsImage1AlignmentNull();
            //}

            if (chkNewsActive.Checked)
            {
                news.NewsActive = true;
                news.FeaturedItem = chkFeaturedItem.Checked;
            }
            else
            {
                news.NewsActive = false;
                news.FeaturedItem = false;
            }

            news.NewsActiveFR = chkNewsActiveFR.Checked;

            news.DateModified = DateTime.Now;
            news.ModifiedByAdminID = Convert.ToInt32(PageUserID);	

            if (isNew)
            {
                news.NewsTypeID = SubTypeID;
                news.DateCreated = DateTime.Now;
                dsNews.tbl_News.Addtbl_NewsRow(news);
            }

            bp.Update(dsNews);
            //NewsID = news.NewsID;
            //SaveLinkInfo(isNew);

            //if (!news.IsNewsImage1Null() && (news.NewsImage1 != tempImageID1))
            //    ResizePageImages(news.NewsImage1); 
        }
Beispiel #13
0
        private DataView GetData()
        {
            BPNews bp = new BPNews();
            DSNews = bp.SelectByNewsTypeID(SubTypeID);

            DSNews.tbl_News.DefaultView.Sort = DSNews.tbl_News.NewsDateColumn.ColumnName + " desc";

            DSNews.tbl_News.DefaultView.RowFilter = RowFilter("NewsTitle", ((LinkButton)rptLetters.Items[0].FindControl("lnkLetter")).CommandName, "NewsActive", lstActive.SelectedValue);
            return DSNews.tbl_News.DefaultView;

        }