예제 #1
0
        private void AddUpdateImageCategory(string pageTitle)
        {
            bool isNew = false;
            BPImageCategories bpImageCats = new BPImageCategories();
            BEImages.tbl_ImageCategoriesRow imageCategory = null;
            BEImages dsImageCats = bpImageCats.SelectByPageID(PageID);

            if (dsImageCats.tbl_ImageCategories.Count > 0)
                imageCategory = dsImageCats.tbl_ImageCategories[0];
            else
            {
                imageCategory = dsImageCats.tbl_ImageCategories.Newtbl_ImageCategoriesRow();
                isNew = true;
            }

            imageCategory.ImageCategoryName = pageTitle;
            imageCategory.ImageCategoryDescription = "Image Gallery For:  " + pageTitle;
            imageCategory.DateModified = DateTime.Now;
            imageCategory.ModifiedByAdminID = PageUserID;

            if (isNew)
            {
                imageCategory.PageID = PageID;
                imageCategory.ImageCategoryOrder = -1;
                imageCategory.ImageCategoryActive = true;
                imageCategory.DateCreated = DateTime.Now;
                dsImageCats.tbl_ImageCategories.Addtbl_ImageCategoriesRow(imageCategory);
            }

            bpImageCats.Update(dsImageCats);
        }
예제 #2
0
        private void DeleteImageGallery(int pageID)
        {
            BPImageCategories bpImageCats = new BPImageCategories();
            BEImages dsImageCats = bpImageCats.SelectByPageID(pageID);

            if (dsImageCats.tbl_ImageCategories.Count > 0)
            {
                ucImageGallery.DeleteAllImages();
                dsImageCats.tbl_ImageCategories[0].Delete();
                bpImageCats.Update(dsImageCats);
            }
        }
예제 #3
0
        private void BindImageGalleryUserControl()
        {
            BPImageCategories bp = new BPImageCategories();
            BEImages ds = bp.SelectByPageID(PageID);
            BEImages.tbl_ImageCategoriesRow category;

            if (ds.tbl_ImageCategories.Count > 0)
            {
                category = ds.tbl_ImageCategories[0];

                ucImageGallery.ImageCategoryID = category.ImageCategoryID;
                ucImageGallery.PageTypeID = PageTypeID;
                ucImageGallery.Visible = true;
                plcNewGalleryMessage.Visible = false;

                plcInactiveGalleryMessage.Visible = !category.ImageCategoryActive;
            }
            else
            {
                ucImageGallery.Visible = false;
                plcNewGalleryMessage.Visible = false;
            }
        }