Exemplo n.º 1
0
        private YachtTours GenerateYachtTourFromCreateModel(YachtTourCreateModel model)
        {
            var cityRespone     = _locationRequestService.GetCityNameById(model.CityFid);
            var countryRespone  = _locationRequestService.GetCountryNameById(model.CountryFid);
            var locationRespone = _locationRequestService.GetLocationNameById(model.CountryFid);

            var tour = new YachtTours();

            //tour.InjectFrom(model);
            //tour.TourDurationValue = model.TourDurationValue;
            tour = _mapper.Map <YachtTourCreateModel, YachtTours>(model, tour);
            //tour.TourDurationUnitResKey = (tour.TourDurationUnitTypeFid > 0) ? "TourDurationUnitResKey" : string.Empty;
            tour.City         = cityRespone.ResponseData ?? string.Empty;
            tour.Country      = countryRespone.ResponseData ?? string.Empty;
            tour.LocationName = locationRespone.ResponseData ?? string.Empty;

            var userId = UserContextHelper.UserId;
            var now    = DateTime.Now.Date;

            tour.UniqueId         = UniqueIDHelper.GenarateRandomString(12);
            tour.Deleted          = false;
            tour.IsActive         = false;
            tour.CreatedDate      = now;
            tour.LastModifiedDate = now;
            tour.CreatedBy        = userId;
            tour.LastModifiedBy   = userId;
            tour.UniqueId         = UniqueIDHelper.GenarateRandomString(12);
            return(tour);
        }
Exemplo n.º 2
0
        private YachtTours GenerateForUpdate(YachtTours tour)
        {
            var userId = UserContextHelper.UserId;
            var now    = DateTime.Now.Date;

            tour.LastModifiedDate = now;
            tour.LastModifiedBy   = userId;
            return(tour);
        }