public int DeleteSoft(object id) { var obj = OBTMDbSet.Find(id); obj.IsDeleted = true; OBTMDbContext.Entry(obj).State = System.Data.Entity.EntityState.Modified; return(OBTMDbContext.SaveChanges()); }
public int SaveEditedBus(BusOperator bus) { var b = OBTMDbContext.BusOperators.Where(i => i.Id == bus.Id).Single(); b.Name = bus.Name; b.Email = bus.Email; OBTMDbContext.Entry(b).State = EntityState.Modified; return(OBTMDbContext.SaveChanges()); }
public int DeleteBusSoft(int id) { var obj = OBTMDbContext.BusOperators.Find(id); obj.IsDeleted = true; OBTMDbContext.Entry(obj).State = EntityState.Modified; return(OBTMDbContext.SaveChanges()); }
public int DeleteSingleRouteForBus(int id) { var obj = OBTMDbContext.OperatorRouteMaps.Where(opId => opId.Id == id).ToList(); foreach (var item in obj) { item.IsDeleted = true; OBTMDbContext.Entry(item).State = EntityState.Modified; } return(OBTMDbContext.SaveChanges()); }
public int DeleteOperatorRouteSoft(int id) { var obj = OBTMDbContext.OperatorRouteMaps.Where(bus => bus.BusOperatorId == id).ToList(); foreach (var item in obj) { item.IsDeleted = true; OBTMDbContext.Entry(item).State = EntityState.Modified; } return(OBTMDbContext.SaveChanges()); }
public int SoftDelete(int id) { DateWiseTrip dateWiseTrip = OBTMDbContext.DateWiseTrips.Find(id); bool isAnySeatPurchased = OBTMDbContext.BookingTickets.Where(bt => bt.DateWiseTripId == dateWiseTrip.Id && bt.IsBooked == true).Any(); if (isAnySeatPurchased) { return(-1); } else { dateWiseTrip.IsDeleted = true; OBTMDbContext.Entry(dateWiseTrip).State = EntityState.Modified; return(OBTMDbContext.SaveChanges()); } }
public BusOpertaorDataAccess(OBTMDbContext context) : base(context) { }
public RoutePointsDataAccess(OBTMDbContext context) : base(context) { }
public GenericDataAccess(OBTMDbContext context) { this.OBTMDbContext = context; this.OBTMDbSet = context.Set <TEntity>(); }
public LocationsDataAccess(OBTMDbContext context) : base(context) { }
public DateWiseTripDataAccess(OBTMDbContext context) : base(context) { }
public TripBaseDataAccess(OBTMDbContext context) : base(context) { }
public OperatorRouteMapDataAccess(OBTMDbContext context) : base(context) { }
public BookingTicketDataAccess(OBTMDbContext context) : base(context) { }
public SeatBaseDataAccess(OBTMDbContext context) : base(context) { }
public UserDataAccess(OBTMDbContext context) : base(context) { }