Ejemplo n.º 1
0
        public List <SingleProductViewModel> FindAllMatchingListings(FindProductInfoViewModel productView)
        {
            var domainModel = createModel.MappingListing(productView);
            var domainList  = ListingHelper.GetAllListingsByProductName(domainModel);

            return(createModel.MappingAllViewListings(domainList));
        }
        public List <FindProductInfoViewModel> FindMatchingProductInfo(FindProductInfoViewModel findProduct)
        {
            var productInfoDomainModel = createModel.MappingProductInfo(findProduct);
            var checkValidation        = validator.ValidateProductTitle(productInfoDomainModel);

            if (checkValidation)
            {
                List <dm.ProductInfo>           results          = FindProductInfoHelper.FindPossibleMatches(productInfoDomainModel);
                List <FindProductInfoViewModel> productViewModel = createModel.MappingViewInfo(results);

                return(productViewModel);
            }
            return(null);
        }
Ejemplo n.º 3
0
        public static decimal TotalPrice(FindProductInfoViewModel findproductinfo)
        {
            var     productsingle = findproductinfo.FindMatchingProductInfo(findproductinfo);
            decimal Price         = 0;

            if (findproductinfo.HelperType == "buy")
            {
                foreach (var item in productsingle)
                {
                    if (item.ProductTitle == findproductinfo.ProductTitle)
                    {
                        Price += item.DisplayPrice;
                    }
                    Price += 0;
                }
            }
            if (findproductinfo.HelperType == "remove")
            {
                Price -= findproductinfo.DisplayPrice;
            }
            return(Price);
        }
        public dm.ProductInfo SelectedViewModel(FindProductInfoViewModel item)
        {
            var productDomainModel = createModel.MappingProductInfo(item);

            return(FindProductInfoHelper.SingleProductInfo(productDomainModel));
        }
        public dm.ProductInfo MappingProductInfo(FindProductInfoViewModel findProduct)
        {
            var productInfoMapper = productInfoConfig.CreateMapper();

            return(productInfoMapper.Map <FindProductInfoViewModel, dm.ProductInfo>(findProduct));
        }
Ejemplo n.º 6
0
        public dm.Listing MappingListing(FindProductInfoViewModel item)
        {
            var listingMapper = listingConfig.CreateMapper();

            return(listingMapper.Map <FindProductInfoViewModel, dm.Listing>(item));
        }