예제 #1
0
		public static coreModel.QuoteItem ToCoreModel(this dataModel.QuoteItemEntity dbEntity)
		{
			if (dbEntity == null)
				throw new ArgumentNullException("dbEntity");

			var retVal = new coreModel.QuoteItem();
			retVal.InjectFrom(dbEntity);
            retVal.Currency = (CurrencyCodes)Enum.Parse(typeof(CurrencyCodes), dbEntity.Currency);
            retVal.ProposalPrices = dbEntity.ProposalPrices.Select(x => x.ToCoreModel()).ToList();

			return retVal;
		}
예제 #2
0
        public static coreModel.QuoteItem ToCoreModel(this dataModel.QuoteItemEntity dbEntity)
        {
            if (dbEntity == null)
            {
                throw new ArgumentNullException("dbEntity");
            }

            var retVal = new coreModel.QuoteItem();

            retVal.InjectFrom(dbEntity);
            retVal.Currency       = (CurrencyCodes)Enum.Parse(typeof(CurrencyCodes), dbEntity.Currency);
            retVal.ProposalPrices = dbEntity.ProposalPrices.Select(x => x.ToCoreModel()).ToList();

            return(retVal);
        }
예제 #3
0
        public static coreModel.QuoteItem ToCoreModel(this webModel.QuoteItem quoteItem)
        {
            var retVal = new coreModel.QuoteItem();
            retVal.InjectFrom(quoteItem);
            retVal.Currency = quoteItem.Currency;

            if (quoteItem.ProposalPrices != null)
            {
                retVal.ProposalPrices = quoteItem.ProposalPrices.Select(x => x.ToCoreModel()).ToList();
            }
            if (quoteItem.SelectedTierPrice != null)
            {
                retVal.SelectedTierPrice = quoteItem.SelectedTierPrice.ToCoreModel();
            }
            return retVal;
        }
예제 #4
0
        public static coreModel.QuoteItem ToCoreModel(this webModel.QuoteItem quoteItem)
        {
            var retVal = new coreModel.QuoteItem();

            retVal.InjectFrom(quoteItem);
            retVal.Currency = quoteItem.Currency;

            if (quoteItem.ProposalPrices != null)
            {
                retVal.ProposalPrices = quoteItem.ProposalPrices.Select(x => x.ToCoreModel()).ToList();
            }
            if (quoteItem.SelectedTierPrice != null)
            {
                retVal.SelectedTierPrice = quoteItem.SelectedTierPrice.ToCoreModel();
            }
            return(retVal);
        }