Beispiel #1
0
        public async Task <int> DeleteDetail(int id)
        {
            await BookingOrderDetailLogic.DeleteModel(id);

            var bookingOrderDetail = await BookingOrderDetailLogic.ReadModelById(id);

            bookingOrderDetail.IsAddNew = false;
            var bookingOrder = await BookingOrderLogic.ReadModelById(bookingOrderDetail.BookingOrderId);

            bookingOrder.canceledItem = bookingOrder.canceledItem + 1;

            if (bookingOrder.BlockingPlanId != null)
            {
                var blockingPlan = await BlockingPlanLogic.ReadModelById((int)bookingOrder.BlockingPlanId);

                BlockingPlanLogic.UpdateModelStatus(blockingPlan.Id, blockingPlan, BlockingPlanStatus.CHANGED);
            }

            BookingOrderLogic.UpdateModel(bookingOrder.Id, bookingOrder);

            return(await DbContext.SaveChangesAsync());
        }
 public async Task <BlockingPlan> ReadById(int id)
 {
     return(await BlockingPlanLogic.ReadModelById(id));
 }