public IActionResult Delete(int id) { var deleteRow = _ISectionService.Delete(id); var delete = _uow.SaveChanges(); return(Json(delete)); }
public HttpResponseMessage Delete(int id) { SucessResponse response = new SucessResponse(); _sectionService.Delete(id); return(Request.CreateResponse(response)); }
public ActionResult DeleteConfirmed(int id) { Section section = sectionService.Get(id); sectionService.Delete(section); return(RedirectToAction("Index")); }
public IActionResult Delete(int articleId) { try { var article = _articleService.GetById(articleId); var findSection = _sectionService.GetByArticleId(article.ArticleId); foreach (var item in findSection) { _sectionService.Delete(item); } var findAuthor = _authorService.GetByArticleId(article.ArticleId); foreach (var item in findAuthor) { _authorService.Delete(item); } _articleService.Delete(article); } catch (Exception e) { return(BadRequest(e.Message)); } return(Ok()); }
public IActionResult Delete(int id) { _SectionService.Delete(id); var response = new APIResponseViewModel(); response.Status = true; response.Message = "ISection Deleted Sucess"; return(Ok(response)); }
public virtual ActionResult Remove(long sectionId) { var section = sectionService.Find(sectionId); if (section != null && permissionService.IsAllowed((Int32)SectionOperations.Manage, this.CorePrincipal(), typeof(Section), sectionId, IsSectionOwner(section), PermissionOperationLevel.Object)) { sectionService.Delete(section); } return(RedirectToAction("Show")); }
public IActionResult DeleteSection(int id) { try { _service.Delete(id); return(Ok("Record Deleted Successfully..")); } catch (AppException ex) { return(BadRequest(new { message = ex.Message })); } }
public ActionResult Delete(Section section) { try { sectionService.Delete(section.SectionId); return(RedirectToAction(nameof(Index))); } catch (ValidationException ex) { ModelState.AddModelError("", ex.Message); return(View(section)); } }
public void Remove_RemovingSection_ShouldRemoveSection() { // Arrange var entity = new Section { Name = "Test" }; _db.Sections.Add(entity); _db.SaveChanges(); var before = _db.Sections.Count(); // Act _service.Delete(entity); _db.SaveChanges(); // Assert Assert.Equal(1, before - _db.Sections.Count()); }
public ActionResult Delete(int id, SubmitType submitType) { var section = _sectionService.GetById(id); var page = _webPageService.GetById(section.WebPageId); if (submitType == SubmitType.Delete) { try { _sectionService.Delete(section); } catch (Exception ex) { ErrorNotification(ex, false); return(View()); } SuccessNotification("Section deleted successfully."); } //return Redirect(_webHelper.ApplicationPath + page.VirtualPath); return(Redirect(page.VirtualPath)); }
public ActionResult Delete(WebPageModel model) { try { var page = _webPageService.GetById(model.Id); var sections = _webPageService.GetSectionsByPageId(model.Id); foreach (var section in sections) { _sectionService.Delete(section); } _webPageService.Delete(page); var urlRecord = _urlRecordService.GetBySlug(page.VirtualPath); _urlRecordService.Delete(urlRecord); return(RedirectToAction("Index")); } catch { return(View()); } }
public IActionResult Delete(int id) { var res = SectionService.Delete(id, GetUser()); return(Redirect(res)); }
public void Delete(Guid id) { _sectionService.Delete(id); }
public IActionResult Delete(int id) { _SectionService.Delete(id); return(Ok(GetResponse("Deleted Successfully"))); }