Esempio n. 1
0
        /// <summary>
        /// Slider Image Listing - Row Deleting
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.GridViewDeleteEventArgs"/> instance containing the event data.</param>
        protected void GdSliderImageManager_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            GridViewRow currentRow = (GridViewRow)this.GdSliderImageManager.Rows[e.RowIndex];

            System.Web.UI.WebControls.Label lblImageID = (System.Web.UI.WebControls.Label)currentRow.FindControl("lblImageID");
            var sliderImageDetail = this.slider.SliderIamgeDetail(Convert.ToInt32(lblImageID.Text));

            var path = Server.MapPath("/Images/Sliders/" + sliderImageDetail.SliderID + "/" + sliderImageDetail.SliderImageID + sliderImageDetail.SliderImageExt);

            File.Delete(path);

            this.slider.DeleteSliderImage(Convert.ToInt32(lblImageID.Text));
            SqlUrlBuilderProvider.ClearCachePageUrl(this.PageID);
            UrlBuilderHelper.ClearUrlElements(this.PageID);

            this.LoadGrid();
        }
Esempio n. 2
0
        /// <summary>
        /// Slider Listing - Row Update
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.GridViewDeleteEventArgs"/> instance containing the event data.</param>
        protected void GdSliderManager_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            GridViewRow currentRow = (GridViewRow)this.GdSliderManager.Rows[e.RowIndex];

            System.Web.UI.WebControls.Label lblSliderID = (System.Web.UI.WebControls.Label)currentRow.FindControl("lblSliderID");
            this.slider.DeleteSlider(Convert.ToInt32(lblSliderID.Text));

            var path = Server.MapPath("/Images/Sliders/" + lblSliderID.Text);

            if (Directory.Exists(path))
            {
                Directory.Delete(path, true);
            }

            SqlUrlBuilderProvider.ClearCachePageUrl(this.PageID);
            UrlBuilderHelper.ClearUrlElements(this.PageID);

            this.LoadGrid();
        }