Esempio n. 1
0
 public BEImages SelectAllNonGalleryResizeInfo()
 {
     BEImages ds = new BEImages();
     DAResizeInfo da = new DAResizeInfo();
     da.SelectAllNonGalleryResizeInfo(ds.tbl_ResizeInfo);
     return ds;
 }
Esempio n. 2
0
 public BEImages SelectNonGalleryResizeInfoByPageTypeID(int pageTypeID)
 {
     BEImages ds = new BEImages();
     DAResizeInfo da = new DAResizeInfo();
     da.SelectNonGalleryResizeInfoByPageTypeID(pageTypeID, ds.tbl_ResizeInfo);
     return ds;
 }
Esempio n. 3
0
 public BEImages SelectAllInactive()
 {
     BEImages ds = new BEImages();
     DAResizeInfo da = new DAResizeInfo();
     da.SelectAllInactive(ds.tbl_ResizeInfo);
     return ds;
 }
Esempio n. 4
0
		public BEImages SelectAllActive()
		{
			DAImages da = new DAImages();
			BEImages ds = new BEImages();
			da.SelectAllActive(ds.tbl_Images);
			return ds;
		}
Esempio n. 5
0
		public BEImages SelectAllInactive()
		{
			BEImages ds = new BEImages();
			DAImageCategories da = new DAImageCategories();
			da.SelectAllInactive(ds.tbl_ImageCategories);
			return ds;
		}
Esempio n. 6
0
 public BEImages SelectByPageID(int pageID)
 {
     BEImages ds = new BEImages();
     DAImageCategories da = new DAImageCategories();
     da.SelectByPageID(pageID, ds.tbl_ImageCategories);
     return ds;
 }
Esempio n. 7
0
 public BEImages SelectAllActiveNonGallery()
 {
     BEImages ds = new BEImages();
     DAImageCategories da = new DAImageCategories();
     da.SelectAllActiveNonGallery(ds.tbl_ImageCategories);
     return ds;
 }
Esempio n. 8
0
		public BEImages SelectByID(int imageid)
		{
			DAImages daD = new DAImages();
			BEImages ds = new BEImages();
			daD.SelectByID(imageid.ToString(), ds.tbl_Images);

			return ds;
		}
Esempio n. 9
0
        public BEImages SelectResizeInfoByID(int resizeInfoID)
        {
            BEImages ds = new BEImages();
            DAResizeInfo da = new DAResizeInfo();

            da.SelectByID(resizeInfoID.ToString(), ds.tbl_ResizeInfo);
            return ds;
        }
Esempio n. 10
0
		public BEImages SelectByID(int ImageCatgeoryID)
		{
			BEImages ds = new BEImages();
			DAImageCategories da = new DAImageCategories();

			da.SelectByID(ImageCatgeoryID.ToString(), ds.tbl_ImageCategories);
			return ds;
		}
Esempio n. 11
0
        public BEImages SelectActiveWithImageCategories()
        {
            DAImages da = new DAImages();
            BEImages ds = new BEImages();

            da.SelectActiveWithImageCategories(ds.tbl_Images);

            return ds;
        }
Esempio n. 12
0
		public BEImages SelectByImageCategoryID(int ImageCategoryID)
		{
			DAImages da = new DAImages();
			BEImages ds = new BEImages();

			da.SelectAllByImageCategoryID(ImageCategoryID, ds.tbl_Images);

			return ds;
		}
Esempio n. 13
0
		protected void BindImageCategories()
		{
			ddlImageCategories.Attributes.Add("onchange", "callToServer(this.form.name, this.name, 'Image', '" + ddlImages.ClientID + "', 'ImageLoader.aspx');");

			BPImageCategories bp = new BPImageCategories();
            DSImageCategories = bp.SelectAllActiveNonGallery();
			DSImageCategories.tbl_ImageCategories.DefaultView.Sort = "ImageCategoryName";

            ddlImageCategories.DataSource = DSImageCategories.tbl_ImageCategories.DefaultView;
            ddlImageCategories.DataValueField = DSImageCategories.tbl_ImageCategories.ImageCategoryIDColumn.ColumnName;
            ddlImageCategories.DataTextField = DSImageCategories.tbl_ImageCategories.ImageCategoryNameColumn.ColumnName;
			ddlImageCategories.DataBind();

			ddlImageCategories.Items.Insert(0, new ListItem("(All Image Categories)", "-1"));
		}
        protected DataView GetData()
        {
            BPImageCategories bp = new BPImageCategories();

            if (ShowGalleries)
                DSImages = bp.SelectAllGalleries();
            else
                DSImages = bp.SelectAllNonGallery();

            string rowFilter = "";
            rowFilter = RowFilter("ImageCategoryName", ((LinkButton)rptLetters.Items[0].FindControl("lnkLetter")).CommandName, "ImageCategoryActive", lstActive.SelectedValue);

            DSImages.tbl_ImageCategories.DefaultView.RowFilter = rowFilter;

            DSImages.tbl_ImageCategories.DefaultView.Sort = DSImages.tbl_ImageCategories.ImageCategoryNameColumn.ColumnName;
            return DSImages.tbl_ImageCategories.DefaultView;
        }
Esempio n. 15
0
		protected void BindImages()
		{
			BPImages bpu = new BPImages();
			DSImages = new BEImages();

			if (FilterID != -1 && FilterID != 0)
			{
                DSImages.Merge(bpu.SelectActiveByImageCategoryID(FilterID));
			}
			else
			{
                DSImages.Merge(bpu.SelectActiveNonGalleryWithImageCategories());
			}

			int ImageCategoryID = -1;
			Boolean blnNew = true;

			StringBuilder returnImages = new StringBuilder(10000);
			 
			returnImages.Append("none,No Image|");

			foreach(DataRow dr in DSImages.tbl_Images.Rows)
			{
				if ((int) dr["ImageCategoryID"] != ImageCategoryID)
				{
					ImageCategoryID = (int) dr["ImageCategoryID"];
					blnNew = true;
				}

				if (blnNew)
				{
					returnImages.Append(",-- " + dr["ImageCategoryName"] + " --|");
					blnNew = false;
				}
				
				returnImages.Append(dr["ImageID"].ToString() + "," + HttpUtility.HtmlDecode("    ") + dr["ImageAlias"].ToString() + "|");
			}

			lblScript.Text = "<script Language=\"Javascript\">window.parent.handleResponse('" + returnImages + "', 'Image')</script>";
		}
Esempio n. 16
0
        protected void BindDropDownFilters()
        {
            BPImageCategories bp = new BPImageCategories();
            BEImages dsImageCategories = new BEImages();

            //galleries dropdown
            dsImageCategories = bp.SelectAllGalleries();
            dsImageCategories.tbl_ImageCategories.DefaultView.Sort = "ImageCategoryName";

            ddlImageGalleries.DataSource = dsImageCategories.tbl_ImageCategories.DefaultView;
            ddlImageGalleries.DataTextField = "ImageCategoryName";
            ddlImageGalleries.DataValueField = "ImageCategoryID";
            ddlImageGalleries.DataBind();

            ddlImageGalleries.Items.Insert(0, new ListItem(" (All Galleries) ", "-1"));
            ddlImageGalleries.Items.Insert(1, new ListItem("Not Assigned", "0"));

            if (FilterCatID != "-1")
                if (ddlImageGalleries.Items.FindByValue(FilterCatID) != null)
                    ddlImageGalleries.SelectedValue = FilterCatID;

            //categories dropdown
            dsImageCategories.Clear();
            dsImageCategories = bp.SelectAllActiveNonGallery();
            dsImageCategories.tbl_ImageCategories.DefaultView.Sort = "ImageCategoryName";

            ddlImageCategories.DataSource = dsImageCategories.tbl_ImageCategories.DefaultView;
            ddlImageCategories.DataTextField = "ImageCategoryName";
            ddlImageCategories.DataValueField = "ImageCategoryID";
            ddlImageCategories.DataBind();

            ddlImageCategories.Items.Insert(0, new ListItem("(All Categories)", "-1"));
            ddlImageCategories.Items.Insert(1, new ListItem("Not Assigned", "0"));

            if (FilterCatID != "-1")
                if (ddlImageCategories.Items.FindByValue(FilterCatID) != null)
                    ddlImageCategories.SelectedValue = FilterCatID;
        }
Esempio n. 17
0
        private bool SaveImageInfo()
        {
            bool isNew = false;
            bool updateExisting = false;
            string strFileName = null;
            BPImages bp = new BPImages();
            BEImages ds = new BEImages();
            BEImages.tbl_ImagesRow image;

            if (ImageID > 0)
            {
                if (inpUpload.PostedFile.FileName == "")
                    updateExisting = true;
            }
            else
                isNew = true;

            if (!updateExisting)
                strFileName = UploadFunctions.UploadFile(inpUpload.PostedFile, Server.MapPath(UploadsPath), UploadTypes.Image);

            if (strFileName != null || updateExisting)
            {
                if (isNew)
                    image = ds.tbl_Images.Newtbl_ImagesRow();
                else
                {
                    ds = bp.SelectByID(ImageID);
                    image = ds.tbl_Images.FindByImageID(ImageID);
                }

                if (!updateExisting)
                    image.ImageName = strFileName;

                image.ImageAlias = txtImageAlias.Text;

                if (txtImageDescription.Text.Trim() != "")
                    image.ImageDescription = txtImageDescription.Text;
                else
                    image.SetImageDescriptionNull();


                image.ImageActive = chkImageActive.Checked;
                image.DateModified = DateTime.Now;
                image.ModifiedByAdminID = ((PageBase)this.Page).PageUserID;

                if (isNew)
                {
                    image.ImageCategoryID = ImageCategoryID;
                    image.ImageOrder = bp.GetImagesMaxOrder(ImageCategoryID);
                    image.DateCreated = DateTime.Now;
                    ds.tbl_Images.Addtbl_ImagesRow(image);
                }

                bp.Update(ds);

                ResizeImage(image);
                return true;
            }
            else
                return false;
        }
Esempio n. 18
0
		public void Update(BEImages ds)
		{
			DAImageCategories da = new DAImageCategories();
			da.Update(ds.tbl_ImageCategories);
		}
Esempio n. 19
0
        private bool SaveImageInfo()
        {
            bool isNew = false;
            bool replacingUploadedFile = false;
            bool doSave = true;
            bool categoryChanged = false;
            string uploadedFileName = null;
            string originalFileName = "";
            int galleryPageTypeID = -1;
            int originalGalleryPageTypeID = -1;
            BPImages bp = new BPImages();
            BEImages ds = new BEImages();
            BEImages.tbl_ImagesRow image;

            if (ImageID > 0)
            {
                if (inpUpload.PostedFile.FileName != "")
                    replacingUploadedFile = true;
            }
            else
                isNew = true;

            if (isNew || replacingUploadedFile)
            {
                uploadedFileName = UploadFunctions.UploadFile(inpUpload.PostedFile, Server.MapPath(ConfigurationManager.AppSettings["UploadsPath"]), UploadTypes.Image);
                if (uploadedFileName == null)
                    doSave = false;
            }

            if (doSave)
            {
                if (isNew)
                    image = ds.tbl_Images.Newtbl_ImagesRow();
                else
                {
                    ds = bp.SelectByID(ImageID);
                    image = ds.tbl_Images.FindByImageID(ImageID);
                }

                image.ImageAlias = txtImageAlias.Text;

                if (txtImageDescription.Text.Trim() != "")
                    image.ImageDescription = txtImageDescription.Text;
                else
                    image.SetImageDescriptionNull();

                //for category/gallery re-assignment in edit mode
                if (!isNew && image.ImageCategoryID != Convert.ToInt32(ddlImageCategories.SelectedValue))
                {
                    if (replacingUploadedFile)
                    {
                        errorMessage = "Gallery/Category change is not permitted when replacing the uploaded file - Please save the new file into the original Gallery/Category.";
                        if (ddlImageCategories.Items.FindByValue(image.ImageCategoryID.ToString()) != null)
                            ddlImageCategories.SelectedValue = image.ImageCategoryID.ToString();
                        return false;
                    }

                    originalGalleryPageTypeID = GetGalleryPageTypeID(image.ImageCategoryID);
                    image.ImageOrder = bp.GetImagesMaxOrder(Convert.ToInt32(ddlImageCategories.SelectedValue));

                    categoryChanged = true;
                }

                image.ImageCategoryID = Convert.ToInt32(ddlImageCategories.SelectedValue);
                image.ImageActive = chkImageActive.Checked;
                image.DateModified = DateTime.Now;
                image.ModifiedByAdminID = PageUserID;

                if (replacingUploadedFile)
                {
                    originalFileName = image.ImageName;
                    image.ImageName = uploadedFileName;
                }

                if (isNew)
                {
                    image.ImageName = uploadedFileName;
                    image.ImageOrder = bp.GetImagesMaxOrder(Convert.ToInt32(ddlImageCategories.SelectedValue));
                    image.DateCreated = DateTime.Now;
                    ds.tbl_Images.Addtbl_ImagesRow(image);
                }

                bp.Update(ds);

                galleryPageTypeID = GetGalleryPageTypeID(image.ImageCategoryID);

                ManageFiles(image.ImageID, image.ImageName, isNew, replacingUploadedFile, 
                             categoryChanged, galleryPageTypeID, originalGalleryPageTypeID, originalFileName);

                return true;
            }
            else
                return false;
        }
Esempio n. 20
0
        private void DeleteImageFiles(BEImages.tbl_ResizeInfoDataTable resizeInfoDataTable, string imageName, bool deleteOriginal)
        {
            foreach (BEImages.tbl_ResizeInfoRow infoRow in resizeInfoDataTable)
                MWUtility.DeleteImageFiles(imageName, infoRow.Prefix, this);

            if (deleteOriginal)
                MWUtility.DeleteImageFiles(imageName, "", this);
        }
Esempio n. 21
0
 private void ResizeImage(BEImages.tbl_ResizeInfoDataTable resizeInfoDataTable, int imageID)
 {
     foreach (BEImages.tbl_ResizeInfoRow infoRow in resizeInfoDataTable)
         MWUtility.CreateResizedImage(imageID, infoRow.MaxImageSize, infoRow.MaxImageWidth, infoRow.MaxImageHeight, infoRow.Prefix, this, infoRow.WidthPriority, infoRow.HeightPriority);
 }
        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. 23
0
		protected void BindImages()
		{
			BPImages bpu = new BPImages();
			DSImages = new BEImages();

			if (ddlImageCategories.SelectedValue != "-1")
			{
                DSImages.Merge(bpu.SelectActiveByImageCategoryID(Convert.ToInt32(ddlImageCategories.SelectedValue)));
			}
			else
			{
                DSImages.Merge(bpu.SelectActiveNonGalleryWithImageCategories());
			}

			int ImageCategoryID = -1;
			Boolean blnNew = true;

			ddlImages.Items.Clear();

			ddlImages.Items.Add(new ListItem("No Image", "0"));
			foreach(DataRow dr in DSImages.tbl_Images.Rows)
			{
				if ((int) dr["ImageCategoryID"] != ImageCategoryID)
				{
					ImageCategoryID = (int) dr["ImageCategoryID"];
					blnNew = true;
				}

				if (blnNew)
				{
					ddlImages.Items.Add(new ListItem("-- " + dr["ImageCategoryName"] + " --", ""));
					blnNew = false;
				}
				
				ddlImages.Items.Add(new ListItem(HttpUtility.HtmlDecode("&nbsp;&nbsp;&nbsp;&nbsp;") + dr["ImageAlias"], dr["ImageID"].ToString()));
			}

			if (SelectedImage != 0)
				ddlImages.SelectedValue = SelectedImage.ToString();
		}
Esempio n. 24
0
 public void Update(BEImages ds)
 {
     DAResizeInfo da = new DAResizeInfo();
     da.Update(ds.tbl_ResizeInfo);
 }
Esempio n. 25
0
        protected DataView GetData()
        {
            BPImages bp = new BPImages();
            
            if(FilterCatID == "-1")
                DSImages = bp.SelectWithImageCategories();
            else
            {
                DSImages = bp.SelectByImageCategoryID(Convert.ToInt32(FilterCatID));
                DSImages.tbl_Images.DefaultView.Sort = "ImageOrder";
            }

            BindMoveControl(DSImages.tbl_Images.DefaultView);

            DSImages.tbl_Images.DefaultView.RowFilter = RowFilter("ImageAlias", ((LinkButton)rptLetters.Items[0].FindControl("lnkLetter")).CommandName, "ImageActive", lstActive.SelectedValue);
            
            return DSImages.tbl_Images.DefaultView;
        }
Esempio n. 26
0
        public BEImages SelectActiveGalleryImagesByPageTypeIDAndPageTypeSpecificID(int pageTypeID, int pageTypeSpecificID)
        {
            DAImages da = new DAImages();
            BEImages ds = new BEImages();

            da.SelectActiveGalleryImagesByPageTypeIDAndPageTypeSpecificID(pageTypeID, pageTypeSpecificID, ds.tbl_Images);

            return ds;
        }
Esempio n. 27
0
 private void ResizeImage(BEImages.tbl_ImagesRow image)
 {
     foreach (BEImages.tbl_ResizeInfoRow infoRow in dsInternal.tbl_ResizeInfo)
     {
         MWUtility.CreateResizedImage(image.ImageID, infoRow.MaxImageSize, infoRow.MaxImageWidth, infoRow.MaxImageHeight, infoRow.Prefix, (PageBase)this.Page, infoRow.WidthPriority, infoRow.HeightPriority);
     }
 }
Esempio n. 28
0
        private void DeleteImageFiles(BEImages.tbl_ImagesRow image)
        {
            PageBase page = (PageBase)this.Page;

            foreach (BEImages.tbl_ResizeInfoRow infoRow in dsInternal.tbl_ResizeInfo)
                MWUtility.DeleteImageFiles(image.ImageName, infoRow.Prefix, page);

            //delete original image file
            MWUtility.DeleteImageFiles(image.ImageName, "", page);
        }