示例#1
0
        //public override void Event_AddUploadedFileInfoIntoDb(IHasUploads entity, UploadObject uploadObj)
        //{
        //    if (uploadObj.NumberOfFiles > 0)
        //    {
        //        foreach (var file in uploadObj.FilesSavedList)
        //        {

        //            file.MetaData.Created.SetToTodaysDate("");

        //            file.ProductCategory3 = entity as ProductCategory3;
        //            file.ProductCategory3Id = entity.Id;

        //            entity.UploadedFiles.Add(file);
        //            UploadedFileBiz.Create(file);

        //        }
        //    }
        //}

        /// <summary>
        /// This deletes/Removes the uploaded file.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="uploadedObjectId"></param>

        public async Task DeleteUploadedFile(string uploadedObjectId)
        {
            //Delete the upload
            await UploadedFileBiz.DeleteAsync(uploadedObjectId);

            //Note. this just marks delete as true.



            //first locate the object
            //ProductCategory3 pc3 = await FindAsync(id);

            //if (pc3.IsNull())
            //{
            //    ErrorsGlobal.Add("Unable to locate the Product Category", MethodBase.GetCurrentMethod());
            //    return;
            //}

            ////remove the object from Category 3
            //UploadedFile upf = pc3.UploadedFiles.FirstOrDefault(x => x.Id == uploadedObjectId);

            //if (!upf.IsNull())
            //{
            //    pc3.UploadedFiles.Remove(upf);

            //}
        }
示例#2
0
        /// <summary>
        /// This deletes/Removes the uploaded file.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="uploadedObjectId"></param>

        public async Task DeleteUploadedFile(string uploadedObjectId)
        {
            //Delete the upload
            await UploadedFileBiz.DeleteAsync(uploadedObjectId);
        }