public bool RemoveRoutePoint(RoutePoint routePoint) { using (var context = new BtmsContext()) { var removeRoutePoint = context.RoutePoints.Find(routePoint.Id); context.RoutePoints.Remove(removeRoutePoint); return(context.SaveChanges() > 0); } }
public bool RemoveTicket(Ticket ticket) { using (var context = new BtmsContext()) { try { var removeTicket = context.Tickets.Find(ticket.Id); context.Tickets.Remove(removeTicket); return(context.SaveChanges() > 0); } catch { return(false); } } }
public bool RemoveRoute(Route route) { using (var context = new BtmsContext()) { try { var removeRoute = context.Routes.Find(route.Id); context.Routes.Remove(removeRoute); return(context.SaveChanges() > 0); } catch (Exception e) { return(false); } } }