public List <Booking> AlarmForBooking() { List <Booking> bookList = new List <Booking>(); foreach (Booking bk in bkRep.GetAllBookings()) { if (bk._endDate.Ticks < DateTime.Now.Ticks && bk._status == true) { bookList.Add(bk); } } return(bookList); }
public void DeleteCategory(int id) { List <Equipment> eqlist = eqRep.GetEquipmentsFromCategory(id, eqRep.GetAllEquipments()); List <Booking> bookList = BookRep.GetAllBookings(); foreach (Booking bk in bookList) { if (bk._equipment != null) { foreach (Equipment eq in bk._equipment.ToList()) { bool check = eqlist.Any(x => x._id == eq._id); if (check) { DeleteEquipmentFromBooking(eq, bk); } } } } foreach (Equipment item in eqlist) { eqData.DeleteById(item._id); eqRep.DeleteById(item._id); } catData.DeleteById(id); CatRep.DeleteById(id); }
public IEnumerable <Booking> Get() { return(_bookingRepository.GetAllBookings()); }
public Booking[] GetRentedEquipmentFromDate(DateTime date) { List <Booking> BookingList = bookrep.GetAllBookings(); return(BookingList.Where(x => x._startDate.Ticks <= date.Ticks && x._endDate.Ticks >= date.Ticks).ToArray()); }