Esempio n. 1
0
        public async Task <Core.Entities.RoomService> AddRoomService(RequestServiceAddModel roomService)
        {
            var dbService = new Core.Entities.RoomService()
            {
                RoomId       = roomService.RoomId,
                CustomerId   = roomService.CustomerId,
                SDesc        = roomService.SDesc,
                ServiceDate  = roomService.ServiceDate,
                CheckIn      = roomService.CheckIn,
                TotalPersons = roomService.TotalPersons,
                BookingDays  = roomService.BookingDays,
                Advance      = roomService.Advance,
                Amount       = roomService.Amount
            };

            return(await _roomServiceRepo.AddAsync(dbService));
        }
Esempio n. 2
0
        public async Task <Core.Entities.RoomService> UpdateById(int id, RequestServiceAddModel roomService)
        {
            // convert RequestServiceAddModel -> RoomService
            var dbService = new Core.Entities.RoomService()
            {
                RoomId       = roomService.RoomId,
                CustomerId   = roomService.CustomerId,
                SDesc        = roomService.SDesc,
                ServiceDate  = roomService.ServiceDate,
                CheckIn      = roomService.CheckIn,
                TotalPersons = roomService.TotalPersons,
                BookingDays  = roomService.BookingDays,
                Advance      = roomService.Advance,
                Amount       = roomService.Amount
            };

            return(await _roomServiceRepo.UpdateAsync(id, dbService));
        }