Esempio n. 1
0
 private string SaveVideoFile(FileUpload fileupload, ref string strErr)
 {
     strErr = string.Empty;
     if (fileupload.HasFile)
     {
         try
         {
             string temp = LWGUtils.SaveVideoFile(fileupload, LWGUtils.GetVideoPath(), ref strErr);
             if (string.IsNullOrEmpty(strErr))
             {
                 return(temp);
             }
         }
         catch (Exception ex)
         {
             //TODO: uploadfile error
             return(string.Empty);
         }
     }
     else
     {
         strErr = LWGUtils.NO_FILE;
     }
     return(string.Empty);
 }
Esempio n. 2
0
        protected void gvVideos_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int       productVideoId = (int)gvVideos.DataKeys[e.RowIndex]["VideoId"];
            VideoBiz  videoBiz       = new VideoBiz();
            lwg_Video video          = videoBiz.GetVideoById(productVideoId);

            if (video != null)
            {
                videoBiz.DeleteCatalogVideo(productVideoId);
                LWGUtils.ClearOldFile(string.Format("{0}{1}", LWGUtils.GetVideoPath(), video.QTFile));
                BindData();
            }
        }
        protected void DeleteButton_Click(object sender, EventArgs e)
        {
            try
            {
                Product product = ProductManager.GetProductById(this.ProductId);
                if (product != null)
                {
                    ProductManager.MarkProductAsDeleted(this.ProductId);

                    CustomerActivityManager.InsertActivity(
                        "DeleteProduct",
                        GetLocaleResourceString("ActivityLog.DeleteProduct"),
                        product.Name);
                    //\ delete catalog
                    CatalogBiz  cBiz = new CatalogBiz();
                    lwg_Catalog lwg  = cBiz.GetByID(this.ProductId);
                    if (lwg != null)
                    {
                        foreach (lwg_Audio audio in lwg.lwg_Audio)
                        {
                            LWGUtils.ClearOldFile(string.Format("{0}{1}", LWGUtils.GetSoundPath(), audio.SoundFile));
                        }
                        foreach (lwg_Video video in lwg.lwg_Video)
                        {
                            LWGUtils.ClearOldFile(string.Format("{0}{1}", LWGUtils.GetVideoPath(), video.QTFile));
                        }
                        cBiz.DeleteCatalog(lwg);
                    }
                    //\
                }
                Response.Redirect("Products.aspx");
            }
            catch (Exception exc)
            {
                ProcessException(exc);
            }
        }