Ejemplo n.º 1
0
        public async Task <IActionResult> Delete(int Id)
        {
            var article = await _articleService.Get(Id);

            if (article.Image != null)
            {
                _cloudinaryService.DeleteFile(article.Image.Id);
            }

            //if(article.Taxonomies.Count != 0)
            //{
            //    await _taxonomyService.Delete(Id);
            //}

            await _articleService.Delete(Id);


            return(RedirectToAction("List"));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(ReportView result)
        {
            var report = await _reportService.Get(result.Id);


            if (result.FormFileImg != null)
            {
                if (report.ReportImage != null)
                {
                    _cloudinaryService.DeleteFile(report.ReportImage.Id);
                }
                var photo = await _cloudinaryService.AddReportImage(result.FormFileImg, report.Id);
            }

            await _reportService.Update(ReportHelpers.MergeViewWithModel(report, result));

            return(RedirectToAction("List"));
        }