public JsonResult EditWeakness(Models.Weakness weakness) { string errorMessage = ""; try { context.Update(weakness); context.SaveChanges(); } catch (Exception e) { errorMessage = e.Message; } if (errorMessage == "") { return(Json("başarılı")); } else { return(Json(errorMessage)); } }
public JsonResult NewWeakness(Models.Weakness weakness) { context.WEAKNESS.Add(weakness); context.SaveChanges(); return(Json("başarılı")); }