コード例 #1
0
 public JsonResult deleteDepartment(comDepartments department)
 {
     try
     {
         new hdlDepartments().delete(department);
     }
     catch (Exception ex)
     {
         Response.StatusCode = 500;
         return(Json(new { error = ex.Message }));
     }
     return(getDepartments());
 }
コード例 #2
0
 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());
 }