public void AddOrderHistory(ClientOrderHistoryDto clientOrderHistoryDto) { var clientOrderHistory = _mapper.Map <ClientOrderHistory>(clientOrderHistoryDto); _clientOrderHistoryRepository.AddOrderHistory(clientOrderHistory); _clientOrderHistoryRepository.Save(); }
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); } }