public BEImages SelectAllNonGalleryResizeInfo() { BEImages ds = new BEImages(); DAResizeInfo da = new DAResizeInfo(); da.SelectAllNonGalleryResizeInfo(ds.tbl_ResizeInfo); return ds; }
public BEImages SelectNonGalleryResizeInfoByPageTypeID(int pageTypeID) { BEImages ds = new BEImages(); DAResizeInfo da = new DAResizeInfo(); da.SelectNonGalleryResizeInfoByPageTypeID(pageTypeID, ds.tbl_ResizeInfo); return ds; }
public BEImages SelectAllInactive() { BEImages ds = new BEImages(); DAResizeInfo da = new DAResizeInfo(); da.SelectAllInactive(ds.tbl_ResizeInfo); return ds; }
public BEImages SelectAllActive() { DAImages da = new DAImages(); BEImages ds = new BEImages(); da.SelectAllActive(ds.tbl_Images); return ds; }
public BEImages SelectAllInactive() { BEImages ds = new BEImages(); DAImageCategories da = new DAImageCategories(); da.SelectAllInactive(ds.tbl_ImageCategories); return ds; }
public BEImages SelectByPageID(int pageID) { BEImages ds = new BEImages(); DAImageCategories da = new DAImageCategories(); da.SelectByPageID(pageID, ds.tbl_ImageCategories); return ds; }
public BEImages SelectAllActiveNonGallery() { BEImages ds = new BEImages(); DAImageCategories da = new DAImageCategories(); da.SelectAllActiveNonGallery(ds.tbl_ImageCategories); return ds; }
public BEImages SelectByID(int imageid) { DAImages daD = new DAImages(); BEImages ds = new BEImages(); daD.SelectByID(imageid.ToString(), ds.tbl_Images); return ds; }
public BEImages SelectResizeInfoByID(int resizeInfoID) { BEImages ds = new BEImages(); DAResizeInfo da = new DAResizeInfo(); da.SelectByID(resizeInfoID.ToString(), ds.tbl_ResizeInfo); return ds; }
public BEImages SelectByID(int ImageCatgeoryID) { BEImages ds = new BEImages(); DAImageCategories da = new DAImageCategories(); da.SelectByID(ImageCatgeoryID.ToString(), ds.tbl_ImageCategories); return ds; }
public BEImages SelectActiveWithImageCategories() { DAImages da = new DAImages(); BEImages ds = new BEImages(); da.SelectActiveWithImageCategories(ds.tbl_Images); return ds; }
public BEImages SelectByImageCategoryID(int ImageCategoryID) { DAImages da = new DAImages(); BEImages ds = new BEImages(); da.SelectAllByImageCategoryID(ImageCategoryID, ds.tbl_Images); return ds; }
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; }
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>"; }
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; }
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; }
public void Update(BEImages ds) { DAImageCategories da = new DAImageCategories(); da.Update(ds.tbl_ImageCategories); }
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; }
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); }
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); }
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(" ") + dr["ImageAlias"], dr["ImageID"].ToString())); } if (SelectedImage != 0) ddlImages.SelectedValue = SelectedImage.ToString(); }
public void Update(BEImages ds) { DAResizeInfo da = new DAResizeInfo(); da.Update(ds.tbl_ResizeInfo); }
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; }
public BEImages SelectActiveGalleryImagesByPageTypeIDAndPageTypeSpecificID(int pageTypeID, int pageTypeSpecificID) { DAImages da = new DAImages(); BEImages ds = new BEImages(); da.SelectActiveGalleryImagesByPageTypeIDAndPageTypeSpecificID(pageTypeID, pageTypeSpecificID, ds.tbl_Images); return ds; }
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); } }
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); }