Esempio n. 1
0
        public async Task <IHttpActionResult> Post(ArrayProductosWithCorreo datos)
        {
            try
            {
                var productoCarritoManager       = new ProductoCarritoManagement();
                var userManager                  = new UserManagement();
                var hotelManagement              = new HotelManagement();
                List <ProductoCarrito> productos = datos.productsArray;
                User tmpUser = new User {
                    Correo = datos.correo
                };
                User            user  = userManager.RetrieveByCorreo(tmpUser);
                CommissionHotel hotel = hotelManagement.getCommision(datos.hotel);

                await productoCarritoManager.SendEmailCart(productos, user, hotel);

                apiResponse = new ApiResponse();

                return(Ok(apiResponse));
            }
            catch (BussinessException bex)
            {
                return(InternalServerError(new Exception(bex.AppMessage.Message)));
            }
        }
Esempio n. 2
0
        public IHttpActionResult GetId(int hotel)
        {
            var hotelManager = new HotelManagement();

            apiResponse = new ApiResponse();
            var hotels = hotelManager.getCommision(hotel);

            apiResponse.Data = hotels;
            return(Ok(apiResponse));
        }
Esempio n. 3
0
        public async System.Threading.Tasks.Task <IHttpActionResult> Post4Async(Hotel hotel)
        {
            var hotelManager = new HotelManagement();
            var userManager  = new UserManagement();

            apiResponse = new ApiResponse();
            decimal         totalPrice      = hotel.DailySales;
            CommissionHotel commissionHotel = hotelManager.getCommision(hotel.Id);
            User            tmpUser         = new User()
            {
                Correo = hotel.Email
            };
            User user = userManager.RetrieveByCorreo(tmpUser);
            await hotelManager.SendMembershipEmail(commissionHotel, user, totalPrice);

            return(Ok(apiResponse));
        }