public ActionResult Update(string key) { try { var pictureId = Convert.ToInt32(Request["Value_DefaultImages"]); if (key != Keyapi) { return(Json(0, JsonRequestBehavior.AllowGet)); } var model = _da.GetById(ItemId); if (pictureId > 0) { model.PictureID = pictureId; } model.Title = HttpUtility.UrlDecode(model.Title); model.Description = HttpUtility.UrlDecode(model.Description); model.Details = HttpUtility.UrlDecode(model.Details); model.SEOTitle = HttpUtility.UrlDecode(model.SEOTitle); model.SEODescription = HttpUtility.UrlDecode(model.SEODescription); model.SEOKeyword = HttpUtility.UrlDecode(model.SEOKeyword); model.DateUpdated = DateTime.Now; UpdateModel(model); _da.Save(); return(Json(1, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(0, JsonRequestBehavior.AllowGet)); } }
public ActionResult EditNews(int id) { if (DataMemory.CurrentUser == null) { return(RedirectToAction("Logout", "Admin")); } var news = (News)CBO.FillObjectFromDataSet(_newsDa.GetById(id), typeof(News)); return(View("~/Areas/Admin/Views/News/Edit.cshtml", news)); }
public News GetById(int id) { return(newsDA.GetById(id)); }