public string EditYearMission(YearMission yearMission) { try { dbContext.Entry(yearMission).State = System.Data.Entity.EntityState.Modified; dbContext.SaveChanges(); return Constants.AJAX_EDIT_SUCCESS_RETURN; } catch (Exception e1) { return "<p class='alert alert-danger'>出错了: " + e1.Message + "</p>"; } }
public string AddYearMission(YearMission yearMission) { try { dbContext.YearMissions.Add(yearMission); dbContext.SaveChanges(); return Constants.AJAX_CREATE_SUCCESS_RETURN; } catch (Exception e1) { return "<p class='alert alert-danger'>出错了: " + e1.Message + "</p>"; } }