Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
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);
         }
     }
 }
Exemplo n.º 3
0
        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);
                }
            }
        }