private void Delete_ClickH(object sender, RoutedEventArgs e) { Entities db = new Entities(); db.houses.Load(); var hs = Convert.ToInt64(DeleteId.Text); houses dll = db.houses.Where(p => p.Id == hs).FirstOrDefault(); db.houses.Remove(dll); db.SaveChanges(); }
private void Add_ClickH(object sender, RoutedEventArgs e) { Entities db = new Entities(); houses House = new houses(); House.Address_City = Ac.Text; House.Address_House = Ah.Text; House.Address_Number = An.Text; House.Address_Street = As.Text; House.Coordinate_latitude = Cl.Text; House.Coordinate_longitude = Clo.Text; House.TotalFloors = F.Text; House.TotalArea = Ta.Text; db.houses.Add(House); db.SaveChanges(); }