public void AddTrack(DetailsOfTrack detailsOfTrack) { DataBaseEntities1 db = new DataBaseEntities1(); db.Track_to_travel.Add(detailsOfTrack.ConvertTrackToDal()); db.SaveChanges(); }
public void UpdateTrack(DetailsOfTrack detailsOfTrack) { Track_to_travel tracks = Mapper.ConvertTrackToDal(detailsOfTrack); using (var db = new DataBaseEntities1()) { db.Entry <Track_to_travel>(db.Set <Track_to_travel>().Find(tracks.Track_s_code)).CurrentValues.SetValues(tracks); db.SaveChanges(); } }
// PUT: api/Track/5 public void Put([FromBody] DetailsOfTrack detailsOfTrack) { ManagmentOTrack.UpdateTrack(detailsOfTrack); }
// POST: api/Track public void Post([FromBody] DetailsOfTrack detailsOfTrack) { ManagmentOTrack.AddTrack(detailsOfTrack); }
public static void UpdateTrack(DetailsOfTrack detailsOfTrack) { ManagementOfTrack.management_of_track.UpdateTrack(detailsOfTrack); }
public static void AddTrack(DetailsOfTrack detailsOfTrack) { ManagementOfTrack.management_of_track.AddTrack(detailsOfTrack); }