Пример #1
0
        /// <summary>
        /// Delete booking by Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool DeleteBooking(int id)
        {
            var entity = dBEntities.BookingDetails.FirstOrDefault(o => o.OrderId == id);

            if (entity == null)
            {
                return(false);
            }
            else
            {
                dBEntities.BookingDetails.Remove(entity);
                dBEntities.SaveChanges();
                return(true);
            }
        }
        /// <summary>
        /// Delete booking by using booking number
        /// </summary>
        /// <param name="bookingNo"></param>
        /// <returns></returns>
        public bool DeleteBooking(string bookingNo)
        {
            var entity = dBEntities.BookingDetails.FirstOrDefault(o => o.BookingNo == bookingNo);

            if (entity == null)
            {
                return(false);
            }
            else
            {
                dBEntities.BookingDetails.Remove(entity);
                dBEntities.SaveChanges();
                return(true);
            }
        }
Пример #3
0
 /// <summary>
 /// Add camp
 /// </summary>
 /// <param name="camp"></param>
 public void AddCamp(CampDTO camp)
 {
     dBEntities.Camps.Add(camp);
     dBEntities.SaveChanges();
 }