protected void btnDelete_Click(object sender, EventArgs e)
        {
            BPImageCategories bp = new BPImageCategories();
            BEImages ds = bp.SelectByID(ImageCategoryID);
            BEImages.tbl_ImageCategoriesRow category = ds.tbl_ImageCategories.FindByImageCategoryID(ImageCategoryID);

            if (category != null)
            {
                category.Delete();
                bp.Update(ds);
                UpdateCategoryItems();
            }

            Response.Redirect("BrowseImageCategories.aspx");
        }
Esempio n. 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);
            }
        }
        private void SaveImageCategoryInfo()
        {
            bool isNew = false;
            BPImageCategories bp = new BPImageCategories();
            BEImages ds = new BEImages();
            BEImages.tbl_ImageCategoriesRow category = null;

            if (ImageCategoryID > 0)
            {
                ds = bp.SelectByID(ImageCategoryID);
                category = ds.tbl_ImageCategories.FindByImageCategoryID(ImageCategoryID);

                if (!IsGallery && (category.ImageCategoryActive && (!chkImageCategoryActive.Checked)))
                    UpdateCategoryItems(); //update images in standard categories only, not page gallery images
            }

            if (category == null)
            {
                category = ds.tbl_ImageCategories.Newtbl_ImageCategoriesRow();
                isNew = true;
            }

            category.ImageCategoryName = txtImageCategoryName.Text;

            if (txtImageCategoryDescription.Text.Trim() != "")
                category.ImageCategoryDescription = txtImageCategoryDescription.Text;
            else
                category.SetImageCategoryDescriptionNull();

            category.ImageCategoryActive = chkImageCategoryActive.Checked;
            category.DateModified = DateTime.Now;
            category.ModifiedByAdminID = PageUserID;

            if (isNew)
            {
                category.PageID = -1;
                category.ImageCategoryOrder = bp.GetImageCategoryMaxOrder();
                category.DateCreated = DateTime.Now;
                ds.tbl_ImageCategories.Addtbl_ImageCategoriesRow(category);
            }

            bp.Update(ds);
        }
Esempio n. 4
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);
        }