Пример #1
0
        private YachtTourPricings GenerateForCreate(int tourId, int yachtId, YachtTourPricingCreateModel model = null)
        {
            var pricingTypeResponse = _commonValueRequestService.
                                      GetCommonValueByGroupInt(CommonValueGroupConstant.YachtTourPricingType, model.TourPricingTypeFid);
            var entity = new YachtTourPricings();
            var now    = DateTime.Now.Date;
            var userId = UserContextHelper.UserId;

            if (model != null)
            {
                entity.InjectFrom(model);
            }
            entity.TourFid  = tourId;
            entity.YachtFid = yachtId;
            entity.TourPricingTypeResKey = pricingTypeResponse.IsSuccessStatusCode ? pricingTypeResponse.ResponseData.ResourceKey : string.Empty;
            entity.CreatedBy             = userId;
            entity.LastModifiedBy        = userId;
            entity.CreatedDate           = now;
            entity.LastModifiedDate      = now;
            entity.Deleted = false;
            return(entity);
        }