コード例 #1
0
        public ActionResult Delete(Guid id)
        {
            var deleted = sub.GetById(id);

            sub.Remove(deleted);
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        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("");
        }
コード例 #3
0
        public ActionResult Delete(Guid id)
        {
            SubCategory gelen = ss.GetByID(id);

            ss.Remove(id);
            return(RedirectToAction("Index", new { id = gelen.CategoryID }));
        }
コード例 #4
0
        public ActionResult Delete(Guid id)
        {
            SubCategory temp = SubCategoryService.GetById(id);

            SubCategoryService.Remove(temp);

            return(RedirectToAction("List"));
        }
コード例 #5
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            SubCategory subCategory = sub.GetById(id);

            sub.Remove(subCategory);

            return(RedirectToAction("Index"));
        }
コード例 #6
0
        public ActionResult Delete(SubCategory subCategory)
        {
            try
            {
                subCategoryService.Remove(subCategory.ID);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
コード例 #7
0
        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"));
        }
コード例 #8
0
        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);
        }
コード例 #9
0
 public ActionResult Delete(Guid id)
 {
     _subCategoryService.Remove(id);
     return(Redirect("/Admin/SubCategory/List"));
 }