public IActionResult Delete(SectionViewModel vm) { var section = _sectionService.GetSectionById(vm.Id); _sectionService.DeleteSection(section); return(RedirectToAction("List", "Section")); }
public ActionResult <SectionAddViewModel> DeleteSection(SectionAddViewModel section) { SectionAddViewModel sectionDelete = new SectionAddViewModel(); try { if (section.tableSections.SchoolId > 0) { sectionDelete = _sectionService.DeleteSection(section); } else { sectionDelete._token = section._token; sectionDelete._tenantName = section._tenantName; sectionDelete._failure = true; sectionDelete._message = "Please enter valid scholl id"; } } catch (Exception es) { sectionDelete._failure = true; sectionDelete._message = es.Message; } return(sectionDelete); }
public ActionResult DeleteSection(int sectionId) { var anyArticle = articleService.GetArticleEntityBySection(sectionId).Any(); if (!anyArticle) { sectionService.DeleteSection(sectionService.GetSectionEntityById(sectionId)); } return(RedirectToAction("WorkWithSections", "Section")); }
public async Task <IActionResult> DeleteSection(Guid id) { var section = (await _service.FindSectionsByCondition(p => p.Id == id, true)).FirstOrDefault(); if (section == null) { return(NotFound()); } _service.DeleteSection(section); await _service.Save(); return(NoContent()); }
public void Can_Add_Section() { // delete it if it exists, before running installer Section section = _sectionService.GetByAlias("workflow"); if (section != null) { _sectionService.DeleteSection(section); } Assert.Null(_sectionService.GetByAlias("workflow")); var install = new Workflow.Helpers.Installer(); Assert.True(install.AddSection(ApplicationContext.Current)); }
public ActionResult DeleteTypeInCourseLevel(int courseId, int levelId, int typeId) { string uid = User.Identity.GetUserId(); if (!courseService.CanUserModifyCourseLevelsAndTypes(uid, courseId)) { this.AddNotification("Ju nuk mund te fshini tipe ne kursin me id:" + courseId, NotificationType.ERROR); return(RedirectToAction("CourseLevelTypes", "Course", new { @courseId = courseId, @levelId = levelId })); } bool result = sectionService.DeleteSection(courseId, levelId, typeId); if (!result) { return(new HttpNotFoundResult()); } var level = levelService.GetLevelById(levelId); var type = typeService.GetTypeById(typeId); this.AddNotification("Tipi " + type.Tipi + " u fshi nga niveli " + level.Emri, NotificationType.SUCCESS); return(RedirectToAction("CourseLevelTypes", "Course", new { @courseId = courseId, @levelId = levelId })); }
public ActionResult Delete(int id) { int result = 0; if (UserRolePermissionForPage.Delete == true) { result = _iCommonService.GetValidateReference("Section", id.ToString()); if (result > 0) { return(RedirectToAction(nameof(Index), new { noDelete = result })); } else { var deletedid = _iSectionService.DeleteSection(id); return(RedirectToAction(nameof(Index))); } } else { return(RedirectToAction("NotFound", "Error")); } }
public RedirectResult SectionDelete(int sectionId) { _sectionService.DeleteSection(sectionId); return(Redirect("/section")); }
public IActionResult Delete(long id) { sectionService.DeleteSection(id); sectionService.SaveSection(); return(RedirectToAction("Index", "Section")); }
public IActionResult DeleteSection(int id) { _sectionService.DeleteSection(id); return(RedirectToAction("Index")); }
public ActionResult DeleteSection(int id) { sectionService.DeleteSection(id); return(RedirectToAction("Sections", "Home")); }