Exemplo n.º 1
0
        //------------------------------------------
        #endregion
        #region ---------------IPhotoable--------------
        public string GetPhotoPath(PhotoTypes photo)
        {
            if (((string)_PhotoExtension).Length > 0)
            {
                string photoName = ItemsFactory.CreateItemsPhotoName(_ItemID);
                string photoPath = DCSiteUrls.GetPath_ItemsPhotoNormalThumbs(OwnerName, ModuleTypeID, CategoryID, ItemID) + photoName;
                switch (photo)
                {
                case PhotoTypes.Original:
                    photoPath = DCSiteUrls.GetPath_ItemsPhotoOriginals(OwnerName, ModuleTypeID, CategoryID, ItemID) + Photo;
                    break;

                case PhotoTypes.Thumb:
                    photoPath = DCSiteUrls.GetPath_ItemsPhotoNormalThumbs(OwnerName, ModuleTypeID, CategoryID, ItemID) + photoName + MoversFW.Thumbs.thumbnailExetnsion;
                    break;

                case PhotoTypes.Big:
                    photoPath = DCSiteUrls.GetPath_ItemsPhotoBigThumbs(OwnerName, ModuleTypeID, CategoryID, ItemID) + photoName + MoversFW.Thumbs.thumbnailExetnsion;
                    break;

                default:
                    photoPath = DCSiteUrls.GetPath_ItemsPhotoNormalThumbs(OwnerName, ModuleTypeID, CategoryID, ItemID) + photoName + MoversFW.Thumbs.thumbnailExetnsion;
                    break;
                }

                return(photoPath);
            }
            else
            {
                return(SiteDesign.NoPhotoPath);
            }
        }
Exemplo n.º 2
0
    //-----------------------------------------------
    #endregion

    #region ---------------SaveFiles---------------
    //-----------------------------------------------
    //SaveFiles
    //-----------------------------------------------
    protected void SaveFiles(ItemsEntity itemsObject)
    {
        #region Save uploaded photo
        //Photo-----------------------------
        if (fuPhoto.HasFile)
        {
            //------------------------------------------------
            //Save new original photo
            fuPhoto.PostedFile.SaveAs(DCServer.MapPath(DCSiteUrls.GetPath_ItemsPhotoOriginals(itemsObject.OwnerName, itemsObject.ModuleTypeID, itemsObject.CategoryID, itemsObject.ItemID)) + itemsObject.Photo);
            //Create new thumbnails
            MoversFW.Thumbs.CreateThumb(DCSiteUrls.GetPath_ItemsPhotoNormalThumbs(itemsObject.OwnerName, itemsObject.ModuleTypeID, itemsObject.CategoryID, itemsObject.ItemID), ItemsFactory.CreateItemsPhotoName(itemsObject.ItemID), fuPhoto.PostedFile, SiteSettings.Photos_NormalThumnailWidth, SiteSettings.Photos_NormalThumnailHeight);
            MoversFW.Thumbs.CreateThumb(DCSiteUrls.GetPath_ItemsPhotoBigThumbs(itemsObject.OwnerName, itemsObject.ModuleTypeID, itemsObject.CategoryID, itemsObject.ItemID), ItemsFactory.CreateItemsPhotoName(itemsObject.ItemID), 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_ItemsFiles(itemsObject.OwnerName, itemsObject.ModuleTypeID, itemsObject.CategoryID, itemsObject.ItemID)) + itemsObject.File);
        }
        #endregion

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

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

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