Exemplo n.º 1
0
        public ActionResult ManageFlags(string Type, string Action, int id)
        {
            if (Type == "Picture")
            {
                Picture pic = PictureManager.GetPictureById(id);
                if (Action == "unflag")
                {
                    pic.IsFlagged = false;
                    PictureManager.EditPictureFlagged(pic);
                }
                else
                {
                    PictureManager.DeletePicture(pic);
                }
            }
            else
            {
                Comment comment = CommentsManage.GetCommentById(id);
                if (Action == "unflag")
                {
                    comment.IsFlagged = false;
                    CommentsManage.EditCommentFlagged(comment);
                }
                else
                {
                    CommentsManage.DeleteComment(comment);
                }
            }

            return(RedirectToAction("ManageFlags"));
        }
Exemplo n.º 2
0
        public JsonResult deleteImage(string resource, string dir)
        {
            PictureManager pm      = new PictureManager();
            bool           deleted = pm.DeletePicture(resource, "blog", dir);

            return(new JsonResult {
                Data = new { result = deleted ? "ok" : "error" }
            });
        }
Exemplo n.º 3
0
        protected void gvwImages_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int            productPictureID = (int)gvwImages.DataKeys[e.RowIndex]["ProductPictureID"];
            ProductPicture productPicture   = ProductManager.GetProductPictureByID(productPictureID);

            if (productPicture != null)
            {
                PictureManager.DeletePicture(productPicture.PictureID);
                ProductManager.DeleteProductPicture(productPicture.ProductPictureID);
                BindData();
            }
        }
Exemplo n.º 4
0
 protected void btnRemoveAvatar_Click(object sender, EventArgs e)
 {
     try
     {
         PictureManager.DeletePicture(NopContext.Current.User.AvatarId);
         NopContext.Current.User = CustomerManager.SetCustomerAvatarId(NopContext.Current.User.CustomerId, NopContext.Current.User.AvatarId);
         BindData();
     }
     catch (Exception exc)
     {
         pnlCustomerAvatarError.Visible   = true;
         lCustomerAvatarErrorMessage.Text = Server.HtmlEncode(exc.Message);
     }
 }
Exemplo n.º 5
0
        protected void btnRemoveImage_Click(object sender, EventArgs e)
        {
            lwg_Person person = null;
            PersonBiz  pbiz   = new PersonBiz();

            person = pbiz.GetByID(this.ComposerId);
            if (person != null)
            {
                PictureManager.DeletePicture(person.PictureID.Value);
                person.PictureID = 0;
                pbiz.SavePerson(person);
                btnRemoveImage.Visible = false;
                BindData();
            }
        }
        protected void btnRemoveImage_Click(object sender, EventArgs e)
        {
            Nop_EmailDirectory email = null;
            int emailid = 0;

            if (Request.QueryString["emailid"] != null && int.TryParse(Request.QueryString["emailid"], out emailid))
            {
                email = emailbiz.GetEmailByID(emailid);
            }
            if (email != null)
            {
                PictureManager.DeletePicture(email.PictureID.Value);
                email.PictureID = 0;
                emailbiz.SaveEmail(email);
                BindData();
            }
        }
 protected void btnRemoveProductVariantImage_Click(object sender, EventArgs e)
 {
     try
     {
         ProductVariant productVariant = ProductManager.GetProductVariantByID(this.ProductVariantID);
         if (productVariant != null)
         {
             PictureManager.DeletePicture(productVariant.PictureID);
             ProductManager.RemoveProductVariantPicture(productVariant.ProductVariantID);
             BindData();
         }
     }
     catch (Exception exc)
     {
         ProcessException(exc);
     }
 }
Exemplo n.º 8
0
 protected void btnRemoveCategoryImage_Click(object sender, EventArgs e)
 {
     try
     {
         var category = CategoryManager.GetCategoryById(this.CategoryId);
         if (category != null)
         {
             PictureManager.DeletePicture(category.PictureId);
             CategoryManager.RemoveCategoryPicture(category.CategoryId);
             BindData();
         }
     }
     catch (Exception exc)
     {
         ProcessException(exc);
     }
 }
 protected void btnRemoveManufacturerImage_Click(object sender, EventArgs e)
 {
     try
     {
         Manufacturer manufacturer = ManufacturerManager.GetManufacturerByID(this.ManufacturerID);
         if (manufacturer != null)
         {
             PictureManager.DeletePicture(manufacturer.PictureID);
             ManufacturerManager.RemoveManufacturerPicture(manufacturer.ManufacturerID);
             BindData();
         }
     }
     catch (Exception exc)
     {
         ProcessException(exc);
     }
 }
Exemplo n.º 10
0
 protected void btnRemoveAvatar_Click(object sender, EventArgs e)
 {
     try
     {
         Customer customer = CustomerManager.GetCustomerById(this.CustomerId);
         if (customer != null)
         {
             PictureManager.DeletePicture(customer.AvatarId);
             CustomerManager.SetCustomerAvatarId(customer.CustomerId, customer.AvatarId);
             BindData();
         }
     }
     catch (Exception exc)
     {
         ShowError(exc.Message);
     }
 }