public ActionResult Delete(QuanHuyenEntity quanHuyenEntity) { QuanHuyenServices service = new QuanHuyenServices(); try { if (service.Delete(quanHuyenEntity)) return Json(RenderResult.RequestCompleted(ViewData, "Xóa thành công")); return Json(RenderResult.RequestCompleted(ViewData, "Xóa không thành công")); } catch (Exception e) { System.Console.WriteLine(e.ToString()); return Json(RenderResult.RequestError(ViewData, "Lỗi xảy ra")); } }
public ActionResult DeleteWithID(string id) { QuanHuyenServices service = new QuanHuyenServices(); if (id == null) return Json(RenderResult.RequestError(ViewData, "Đối số không hợp lệ")); try { List<int> ids = StringUtility.SplitIdEntity(id); for (int i = 0; i < ids.Count; ++i) { service.Delete(ids[i]); } return Json(RenderResult.RequestCompleted(ViewData, "Xóa thành công")); } catch (Exception e) { System.Console.WriteLine(e.ToString()); return Json(RenderResult.RequestError(ViewData, "Lỗi xảy ra")); } }