public JsonResult deleteDepartment(comDepartments department) { try { new hdlDepartments().delete(department); } catch (Exception ex) { Response.StatusCode = 500; return(Json(new { error = ex.Message })); } return(getDepartments()); }
public JsonResult saveDepartment(comDepartments department) { try { new hdlDepartments().save(department, Convert.ToInt32(Session["UserId"]), Convert.ToBoolean(Session["isAdmin"])); } catch (Exception ex) { Response.StatusCode = 500; return(Json(new { error = ex.Message })); } return(getDepartments()); }