コード例 #1
0
 public ActionResult Remove(long?Id)
 {
     if (Id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     Dao.Delete(Id);
     return(RedirectToAction("Index"));
 }
コード例 #2
0
        public ActionResult Delete(long id)
        {
            var contentDao = new ContentDao();
            var rs         = contentDao.Delete(id);

            if (rs)
            {
                return(RedirectToAction("Index"));
            }
            return(View());
        }
コード例 #3
0
        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"));
            }
        }
コード例 #4
0
        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"));
        }
コード例 #5
0
        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());
            }
        }