Пример #1
0
        /// <summary>
        /// create hotel tax
        /// </summary>
        /// <param name="taxVm"></param>
        /// <returns></returns>
        public Task <BaseResult <long> > CreateHotelTaxRelation(HotelTaxRelationViewModel taxVm)
        {
            HotelTaxRelation tax = new HotelTaxRelation
            {
                HotelId            = taxVm.HotelId,
                TaxTypeId          = taxVm.TaxTypeId,
                TaxApplicabilityId = taxVm.TaxApplicabilityId,
                Amount             = taxVm.Amount,
                IsIncludedInRates  = taxVm.IsIncludedInRates
            };

            return(iHotelTaxRelation.InsertEntity(tax));
        }
Пример #2
0
        /// <summary>
        /// create hotel tax
        /// </summary>
        /// <param name="taxVm"></param>
        /// <returns></returns>
        public Task <BaseResult <long> > CreateHotelTaxRelation(List <HotelTaxRelationViewModel> list)
        {
            var modelList = new List <HotelTaxRelation>();

            foreach (var item in list)
            {
                HotelTaxRelation model = new HotelTaxRelation
                {
                    HotelId            = item.HotelId,
                    TaxTypeId          = item.TaxTypeId,
                    TaxApplicabilityId = item.TaxApplicabilityId,
                    Amount             = item.Amount,
                    IsIncludedInRates  = item.IsIncludedInRates
                };
                modelList.Add(model);
            }
            return(iHotelTaxRelation.InsertEntityList(modelList));
        }
Пример #3
0
 /// <summary>
 /// Resolve remaining parameters
 /// </summary>
 /// <param name="destination"></param>
 /// <param name="source"></param>
 public static void ResolveRemainingParamters(HotelTaxRelation destination, HotelTaxRelation source)
 {
     destination.HotelId            = source.HotelId;
     destination.TaxApplicabilityId = source.TaxApplicabilityId;
 }
Пример #4
0
        /// <summary>
        /// taxes automapper
        /// </summary>
        /// <param name="taxViewModel"></param>
        /// <param name="taxDatabase"></param>
        /// <returns>mapped hoteltax</returns>
        public static HotelTaxRelation AutomapperTaxes(HotelTaxRelationViewModel taxViewModel, HotelTaxRelation taxDatabase)
        {
            var taxMapped = AutoMapper.Mapper.Map <HotelTaxRelation>(taxViewModel);

            ResolveRemainingParamters(taxMapped, taxDatabase);
            return(taxMapped);
        }