Beispiel #1
0
    //--------------------------------------------------------
    #endregion

    #region ---------------SaveFiles---------------
    //-----------------------------------------------
    //SaveFiles
    //-----------------------------------------------
    protected void SaveFiles(ItemCategoriesEntity itemCategoriesObject)
    {
        #region Save uploaded photo
        //Photo-----------------------------
        if (fuPhoto.HasFile)
        {
            //------------------------------------------------
            //Save new original photo
            fuPhoto.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_ItemCategoriesPhotoOriginals(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID)) + itemCategoriesObject.Photo);
            //Create new thumbnails
            MoversFW.Thumbs.CreateThumb(DCSiteUrls.GetPath_ItemCategoriesPhotoNormalThumbs(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID), ItemCategoriesFactory.CreateItemCategoriesPhotoName(itemCategoriesObject.CategoryID), fuPhoto.PostedFile, SiteSettings.Photos_NormalThumnailWidth, SiteSettings.Photos_NormalThumnailHeight);
            MoversFW.Thumbs.CreateThumb(DCSiteUrls.GetPath_ItemCategoriesPhotoBigThumbs(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID), ItemCategoriesFactory.CreateItemCategoriesPhotoName(itemCategoriesObject.CategoryID), fuPhoto.PostedFile, SiteSettings.Photos_BigThumnailWidth, SiteSettings.Photos_BigThumnailHeight);
            //-------------------------------------------------------
        }
        #endregion

        #region Save uploaded file
        //File-----------------------------
        if (fuFile.HasFile)
        {
            //Save new original file
            fuFile.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_ItemCategoriesFiles(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID)) + itemCategoriesObject.File);
        }
        #endregion

        #region Save uploaded video
        //Video-----------------------------
        if (fuVideo.HasFile)
        {
            fuVideo.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_ItemCategoriesFiles(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID)) + itemCategoriesObject.Video);
        }
        #endregion

        #region Save uploaded audio
        //Audio-----------------------------
        if (fuAudio.HasFile)
        {
            fuAudio.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_ItemCategoriesFiles(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID)) + itemCategoriesObject.Audio);
        }
        #endregion

        #region Save uploaded photo2
        //-------------------------------------------------------------------------------------
        //Photo2-----------------------------
        if (fuPhoto2.HasFile)
        {
            fuPhoto2.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_ItemCategoriesFiles(itemCategoriesObject.OwnerName, itemCategoriesObject.ModuleTypeID, itemCategoriesObject.CategoryID)) + itemCategoriesObject.Photo2);
        }
        #endregion
    }