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

                MenuTypeDao bdDao = new MenuTypeDao();
                MenuDao     mnDao = new MenuDao();
                if (mnDao.FindByMenuType(id).Count > 0)
                {
                    SetAlert("Đang sử dụng không được phép xóa", SystemConsts.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());
            }
        }