public ActionResult Delete(Guid id) { var deleted = sub.GetById(id); sub.Remove(deleted); return(RedirectToAction("Index")); }
public String Delete(int level, int ID) { try { if (level == 1) { if (mainCategoryService.GetByID(ID) != null) { mainCategoryService.Remove(ID); return("mainCategory Deleted Sucessfully"); } else { return("mainCategory Not Found !"); } } else if (level == 2) { if (subCategoryService.GetByID(ID) != null) { subCategoryService.Remove(ID); return("subCategory Deleted Sucessfully"); } else { return("subCategory Not Found !"); } } else if (level == 3) { if (trackService.GetByID(ID) != null) { trackService.Remove(ID); return("track Deleted Sucessfully"); } else { return("track Not Found !"); } } else if (level == 4) { if (courseService.GetByID(ID) != null) { courseService.Remove(ID); return("course Deleted Sucessfully"); } else { return("course Not Found !"); } } } catch (Exception ex) { return("Something Went Wrong !!"); } return(""); }
public ActionResult Delete(Guid id) { SubCategory gelen = ss.GetByID(id); ss.Remove(id); return(RedirectToAction("Index", new { id = gelen.CategoryID })); }
public ActionResult Delete(Guid id) { SubCategory temp = SubCategoryService.GetById(id); SubCategoryService.Remove(temp); return(RedirectToAction("List")); }
public ActionResult DeleteConfirmed(Guid id) { SubCategory subCategory = sub.GetById(id); sub.Remove(subCategory); return(RedirectToAction("Index")); }
public ActionResult Delete(SubCategory subCategory) { try { subCategoryService.Remove(subCategory.ID); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Delete(Guid id) { bool sonuc = _subcategoryService.Remove(id); if (sonuc) { ShowMessage(Utility.MessageType.Success, "Silme başarılıdır", 3, true); } else { ShowMessage(Utility.MessageType.Danger, "Silme hatalıdır", 3, false); } return(RedirectToAction("Index", "SubCategory")); }
public ResultViewModel <SubCategoryEditViewModel> Delete(int id) { ResultViewModel <SubCategoryEditViewModel> result = new ResultViewModel <SubCategoryEditViewModel>(); try { if (!ModelState.IsValid) { result.Message = "In Valid Model State"; } else { subCategoryService.Remove(id); result.Successed = true; } } catch (Exception ex) { result.Successed = false; result.Message = "Semething Went Wrong"; } return(result); }
public ActionResult Delete(Guid id) { _subCategoryService.Remove(id); return(Redirect("/Admin/SubCategory/List")); }