public IActionResult CategoryEdit(int?id) { var entity = _categoryServices.GetById((int)id); var model = new CategoryModel() { CategoryId = entity.CategoryId, Title = entity.Title }; return(View(model)); }
public IActionResult ArticleCategoryEditAdmin(int id) { var entity = _categoryServices.GetById(id); var model = new CategoryModel() { CategoryId = entity.CategoryId, Tittle = entity.Tittle, Url = entity.Url, Image = entity.Image }; return(View(model)); }
public JsonResult Edit(int id) { if (id == 0) { return(Json(0)); } var category = _categoryServices.GetById(id); if (category == null) { return(Json(0)); } else { return(Json(category)); } }
// GET: Admin/Categories/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Category category = _category.GetById(id); if (category == null) { return(HttpNotFound()); } return(View(category)); }
public IActionResult CategoryEdit(CategoryModel model) { //var entity=_categoryServices.GetById(model.CategoryId); var entity = _categoryServices.GetById(model.CategoryId); if (entity == null) { return(NotFound()); } entity.Name = model.Name; entity.Url = model.Url; _categoryServices.Update(entity); var msg = new AlertMessage() { Message = $"{entity.Name} isimli kategori güncellendi", AlertType = "primary" }; TempData["message"] = JsonConvert.SerializeObject(msg); return(RedirectToAction("CategoryList")); }
public HttpResponseMessage Delete(int id) { var cate = _categoryServices.GetById(id); return(ToJson(_categoryServices.Delete(cate))); }
public ActionResult <CategoryViewModel> Get(Guid key) { var resultService = _categoryServices.GetById(key); return(_mapper.Map <CategoryViewModel>(resultService)); }