Пример #1
0
        public void AddOrderHistory(ClientOrderHistoryDto clientOrderHistoryDto)
        {
            var clientOrderHistory = _mapper.Map <ClientOrderHistory>(clientOrderHistoryDto);

            _clientOrderHistoryRepository.AddOrderHistory(clientOrderHistory);
            _clientOrderHistoryRepository.Save();
        }
Пример #2
0
        public ClientOrderHistoryDto CreateOrderOutput(OrderSplitedDto orderInfoDto, string clientOrderInput)
        {
            var clientOrderHistoryDto = new ClientOrderHistoryDto();

            clientOrderHistoryDto.ClientOrderInput = clientOrderInput;

            if (orderInfoDto.DayPeriod == DayPeriodEnum.morning)
            {
                clientOrderHistoryDto.ClientOrderOutput = CreateMorningDishesFromInput(orderInfoDto.DishesList);
                return(clientOrderHistoryDto);
            }
            else if (orderInfoDto.DayPeriod == DayPeriodEnum.night)
            {
                clientOrderHistoryDto.ClientOrderOutput = CreateNightDishesFromInput(orderInfoDto.DishesList);
                return(clientOrderHistoryDto);
            }
            else
            {
                clientOrderHistoryDto.ClientOrderOutput = "error";
                return(clientOrderHistoryDto);
            }
        }