public BEImages SelectAllInactive() { DAImages da = new DAImages(); BEImages ds = new BEImages(); da.SelectAllInactive(ds.tbl_Images); 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 SelectAllByImageCategoryID(int ImageCategoryID) { DAImages da = new DAImages(); BEImages ds = new BEImages(); da.SelectAllByImageCategoryID(ImageCategoryID, ds.tbl_Images); return ds; }
public BEImages SelectAllWithImageCategories() { DAImages da = new DAImages(); BEImages ds = new BEImages(); da.SelectAllWithImageCategories(ds.tbl_Images); return ds; }
protected void BindImages() { BPImages bpu = new BPImages(); DSImages = new BEImages(); if (FilterID != -1 && FilterID != 0) { DSImages.Merge(bpu.SelectAllByImageCategoryID(FilterID)); } else { DSImages.Merge(bpu.SelectAllWithImageCategories()); } 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>"; }
private void Page_Load(object sender, EventArgs e) { this.AuthenticatePage(new string[] {PermissionLevels.EditImages, PermissionLevels.AddImages, PermissionLevels.ViewImages}); if (ImageID > 0) { if (this.OryxUser.RolePermission(PermissionLevels.EditImages) != 2) { btnSubmit.Visible = false; btnDelete.Visible = false; } else { btnSubmit.Visible = true; btnDelete.Visible = true; } } else { if (this.OryxUser.RolePermission(PermissionLevels.AddImages) != 2) { btnSubmit.Visible = false; } } if (IsNewSession) { AddToListIfAdmin(); IsNewSession = false; } if (!Page.IsPostBack) { BindImageCategories(); BPImages bp = new BPImages(); if (ImageID != 0) { DSImages = bp.SelectByID(ImageID); Image = DSImages.tbl_Images.FindByImageID(ImageID); //ddlExtranetClients.SelectedValue = Image.ClientID.ToString(); lblImageName.Text = Image.ImageName.ToString(); txtAlias.Text = Image.ImageAlias; chkSingle.Checked = Image.ImageActive; txtDesc.Text = (Image.IsImageDescriptionNull())? string.Empty : Image.ImageDescription; if (ddlImageCategory.Items.FindByValue(Image.ImageCategoryID.ToString()) != null) { ddlImageCategory.SelectedValue = Image.ImageCategoryID.ToString(); } lblTitle.Text = "Edit Image - " + Image.ImageAlias; } else { btnDelete.Visible = false; lblTitle.Text = "Upload Image"; } } }
// private void ddlCategories_SelectedIndexChanged(object sender, System.EventArgs e) // { // BindSubCategories(); // } private void btnDelete_Click(object sender, EventArgs e) { BPImages bp = new BPImages(); BEImages.tbl_ImagesRow Image; DSImages = bp.SelectByID(ImageID); Image = DSImages.tbl_Images.FindByImageID(ImageID); File.Delete(Server.MapPath(@System.Configuration.ConfigurationSettings.AppSettings["UploadsPath"] + Image.ImageName)); Image.Delete(); bp.Update(DSImages); //remove all instances of this image in Products // BPProducts bpProducts = new BPProducts(); // bpProducts.RemoveImagesByImageID(ImageID); Response.Redirect("BrowseImages.aspx"); }
private void BindDSImages() { BPImages bp = new BPImages(); if (ddlImageCategories.SelectedValue == "-1") { DSImages = bp.SelectAllWithImageCategories(); } else { DSImages = bp.SelectAllByImageCategoryID(Convert.ToInt32(ddlImageCategories.SelectedValue)); } DSImages.tbl_Images.DefaultView.Sort = "ImageAlias"; DSImages.tbl_Images.DefaultView.RowFilter = RowFilter("ImageAlias", "ImageActive"); letters_Bind(); dgDocs.DataBind(); SetPagerButtons(); if (DSImages.tbl_Images.DefaultView.Count == 0) { lblError.Visible = true; lblError.Text = "0 Records found."; } else { lblError.Visible = false; lblError.Text = ""; } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.DSImages = new BEImages(); this.DSImages.BeginInit(); this.btnImage.Click += new EventHandler(this.btnImage_Click); this.ddlImageCategories.SelectedIndexChanged += new EventHandler(this.ddlImageCategories_SelectedIndexChanged); this.dgDocs.ItemCommand += new DataGridCommandEventHandler(this.dgDocs_ItemCommand); //this.dgDocs.ItemDataBound += new DataGridItemEventHandler(dgDocs_ItemDataBound); // // DSImages // this.DSImages.DataSetName = "DSImages"; this.DSImages.Locale = new CultureInfo("en-US"); this.Load += new EventHandler(this.Page_Load); this.DSImages.EndInit(); }
public void Update(BEImages ds) { DAImages da = new DAImages(); da.Update(ds.tbl_Images); }