Exemplo n.º 1
0
 public ActionResult Delete(int departmentId)
 {
     if (DepartmentBO.GetById(departmentId) != null)
     {
         DepartmentBO.Delete(departmentId);
         return(RedirectToAction("Index"));
     }
     else
     {
         //ModelState.AddModelError("", "Có lỗi trong quá trình xóa");
         return(RedirectToAction("NotFound", "Home"));
     }
     return(View());
 }
Exemplo n.º 2
0
        public ActionResult Delete(int DepartmentId)
        {
            ResponseViewModel resp = new ResponseViewModel();

            try
            {
                resp = DepartmentObject.Delete(DepartmentId);
            }
            catch (Exception ex)
            {
                resp.Success = false;
                resp.Message = ex.Message;
            }

            return(Json(resp, JsonRequestBehavior.AllowGet));
        }