Example #1
0
        public bool CreateHandling(HandlingBl handling)
        {
            try
            {
                Handling handling1 = new Handling
                {
                    IdClient   = handling.IdClient,
                    InCheck    = handling.InCheck,
                    OutCheck   = handling.OutCheck,
                    IdRoom     = handling.IdRoom,
                    IdService  = handling.IdService == 0 ? null : handling.IdService,
                    IdService2 = handling.IdService2 == 0 ? null : handling.IdService2,
                    IdService3 = handling.IdService3 == 0 ? null : handling.IdService3,
                    IdBooking  = handling.IdBooking == 0 ? null : handling.IdBooking,
                    IdEmployee = handling.IdEmployee,
                };
                _context.Handling.Add(handling1);
                _context.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw;
            }
        }
Example #2
0
 public bool EditHandling(HandlingBl handling)
 {
     try
     {
         Handling handling1 = new Handling
         {
             Id       = handling.Id,
             IdClient = handling.IdClient,
             InCheck  = handling.InCheck,
             OutCheck = handling.OutCheck,
             IdRoom   = handling.IdRoom,
             //IdService = handling.IdService,
             //IdService2 = handling.IdService2,
             //IdService3 = handling.IdService3,
             IdService  = null,
             IdService2 = null,
             IdService3 = null,
             IdBooking  = null,
             IdEmployee = handling.IdEmployee,
         };
         _context.Handling.Update(handling1);
         _context.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #3
0
        public BookingBl GetBooking(int IdClient, int IdRoom)
        {
            ClientBl   clientBl   = GetClient(IdClient);
            RoomBl     roomBl     = GetRoom(IdRoom);
            HandlingBl handlingBl = new HandlingBl();
            BookingBl  bookingBl  = new BookingBl
            {
                client   = clientBl,
                room     = roomBl,
                handling = handlingBl,
            };

            return(bookingBl);
        }