Exemplo n.º 1
0
        public async Task <BookingsHistoryRegisterResponseModel> CreateHistory(BookingsHistoryRegisterRequestModel registerRequestModel)
        {
            var history = new BookingsHistory
            {
                Email         = registerRequestModel.Email,
                BookingDate   = registerRequestModel.BookingDate,
                BookingTime   = registerRequestModel.BookingTime,
                FromPlace     = registerRequestModel.FromPlace,
                ToPlace       = registerRequestModel.ToPlace,
                PickupAddress = registerRequestModel.PickupAddress,
                Landmark      = registerRequestModel.Landmark,
                PickupDate    = registerRequestModel.PickupDate,
                PickupTime    = registerRequestModel.PickupTime,
                CabTypeId     = registerRequestModel.CabTypeId,
                ContactNo     = registerRequestModel.ContactNo,
                Status        = registerRequestModel.Status,
                Comp_Time     = registerRequestModel.Comp_Time,
                Charge        = registerRequestModel.Charge,
                Feedback      = registerRequestModel.Feedback
            };

            var createdHistory = await _bookingsHistory.AddAsync(history);

            var createdHistoryResponseModel = new BookingsHistoryRegisterResponseModel
            {
                Id            = createdHistory.Id,
                Email         = createdHistory.Email,
                BookingDate   = createdHistory.BookingDate,
                BookingTime   = createdHistory.BookingTime,
                FromPlace     = createdHistory.FromPlace,
                ToPlace       = createdHistory.ToPlace,
                PickupAddress = createdHistory.PickupAddress,
                Landmark      = createdHistory.Landmark,
                PickupDate    = createdHistory.PickupDate,
                PickupTime    = createdHistory.PickupTime,
                CabTypeId     = createdHistory.CabTypeId,
                ContactNo     = createdHistory.ContactNo,
                Status        = createdHistory.Status,
                Comp_Time     = createdHistory.Comp_Time,
                Charge        = createdHistory.Charge,
                Feedback      = createdHistory.Feedback
            };

            return(createdHistoryResponseModel);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> CreateHistory(BookingsHistoryRegisterRequestModel model)
        {
            var history = await _bookingsHistory.CreateHistory(model);

            return(Ok(history));
        }