示例#1
0
        public bool?IsThereDiscount(PassengerCruiseModel request)
        {
            List <PassengerCruiseDTO> passengerCruise = new List <PassengerCruiseDTO>();
            decimal cabinValue = 0;

            foreach (var item in request.PassengerCruise)
            {
                passengerCruise.Add(
                    new PassengerCruiseDTO()
                {
                    PassengerCode = item.PassengerCode, Cruise = new CruiseDTO()
                    {
                        CabinValue = item.CabinValue
                    }
                }
                    );
                cabinValue += item.CabinValue;
            }

            var cruise = new CruiseDTO()
            {
                PassengerCruise = passengerCruise,
                CabinValue      = cabinValue
            };

            return(_simpleLogicTest.IsThereDiscount(cruise));
        }
 public bool?IsThereDiscount([FromBody] PassengerCruiseModel request)
 {
     return(_cruiseService.IsThereDiscount(request));
 }