private void detach_Locations(Location entity) { this.SendPropertyChanging(); entity.Hotel = null; }
private void attach_Locations(Location entity) { this.SendPropertyChanging(); entity.Hotel = this; }
partial void DeleteLocation(Location instance);
partial void UpdateLocation(Location instance);
partial void InsertLocation(Location instance);
public ActionResult AddMapLoc(LocationModel lmodel) { try { HolidayPlanner.DAL.Location lc = new HolidayPlanner.DAL.Location() { LocationId = lmodel.LocationId, LocationName=lmodel.LocationName, Latitude=lmodel.Latitude, Longitude=lmodel.Longitude, HotelId=lmodel.HotelId }; context.Locations.InsertOnSubmit(lc); context.SubmitChanges(); return RedirectToAction("Index"); } catch { return View(lmodel); } }