Beispiel #1
0
        public ActionResult Delete(long id)
        {
            try
            {
                // TODO: Add delete logic here

                CategoryDao bdDao = new CategoryDao();
                ProjectDao  prDao = new ProjectDao();
                if (prDao.FindByCategory(id).Count > 0)
                {
                    SetAlert("Đang sử dụng không được phép xóa", Common.CommonConstant.ALERT_DANGER);
                    return(RedirectToAction("Index"));
                }
                bdDao.Delete(id);
                // SetAlert("Xóa thành công", "success");
                return(RedirectToAction("Index"));
            }
            catch
            {
                // SetAlert("Không xóa được", "danger");
                return(View());
            }
        }