public ActionResult Remove(long?Id) { if (Id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Dao.Delete(Id); return(RedirectToAction("Index")); }
public ActionResult Delete(long id) { var contentDao = new ContentDao(); var rs = contentDao.Delete(id); if (rs) { return(RedirectToAction("Index")); } return(View()); }
public ActionResult Delete(long id) { string result = contentDao.Delete(id); if (result == COMMON_CONSTANTS.DELETE_SUCCESS) { return(RedirectToAction("Index", "Content")); } else { return(RedirectToAction("Index", "Error")); } }
public ActionResult Delete(string id) { if (id == null || !Regex.IsMatch(id, @"\d")) { return(RedirectToAction("Index", "Content")); } var contentDao = new ContentDao(); contentDao.Delete(Int32.Parse(id)); ShowNotify("Delete successfully", "success"); return(RedirectToAction("Index")); }
public ActionResult Delete(long id) { try { // TODO: Add delete logic here ContentDao bdDao = new ContentDao(); bdDao.Delete(id); // SetAlert("Xóa thành công", "success"); return(RedirectToAction("Index")); } catch { // SetAlert("Không xóa được", "danger"); return(View()); } }