Exemple #1
0
 public static List <ProductVideoModel> GetProductVideoModel(String code)
 {
     using (var client = new LandauPortalWebAPI())
     {
         return(GetProductVideoModel(code, client));
     }
 }
Exemple #2
0
        public static bool SignUp(SignupModel model)
        {
            using (var client = new LandauPortalWebAPI())
            {
                var signupModel = new SignUp(model.Brand, model.Email);
                signupModel.EntryDate = DateTime.Now;
                signupModel.LastName  = string.Empty;
                signupModel.FirstName = string.Empty;
                signupModel.Phone     = string.Empty;

                try
                {
                    //client.SignUps.CreateSignUps(model.Brand, signupModel);
                    client.SignUps.CreateSignUpsInSalesforce(model.Brand, signupModel);
                    return(true);
                }
                catch (Exception e) {
                    if (e is HttpOperationException)
                    {
                        var httpEx = (HttpOperationException)e;
                        return(httpEx.Response.IsSuccessStatusCode);
                    }
                }
                return(false);
            }
        }
Exemple #3
0
        public static ProductReviewModelList GetProductReviewModel(ReviewFilter reviewFilter)
        {
            using (var client = new LandauPortalWebAPI())
            {
                var reviews = client.ProductReviews.GetAllByProduct(reviewFilter.Code, reviewFilter.PageNumber, reviewFilter.Size);

                ProductReviewModelList productReviewModelList = new ProductReviewModelList();
                productReviewModelList.List = reviews.Results.Select(s => new ProductReviewModel()
                {
                    Comments  = s.Comments,
                    FirstName = s.FirstName,
                    LastName  = s.LastName,
                    Rating    = s.Rating ?? 0,
                    EntryDate = (DateTimeOffset)s.EntryDate
                }).ToList();

                PaginationModel pagination = new PaginationModel();
                pagination.CurrentPage = reviews.Pagination.CurrentPage ?? 0;
                pagination.PageCount   = reviews.Pagination.TotalPages ?? 0;
                pagination.PageSize    = reviews.Pagination.PageSize ?? 0;
                pagination.TotalCount  = reviews.Pagination.TotalCount ?? 0;

                productReviewModelList.Pagination = pagination;
                productReviewModelList.Average    = reviews.Average ?? 0;
                return(productReviewModelList);
            }
        }
Exemple #4
0
 public static List <ProductImageModel> GetProductImageModelByColor(String code, String color)
 {
     using (var client = new LandauPortalWebAPI())
     {
         return(GetProductImageModelByColor(code, color, client));
     }
 }
Exemple #5
0
 public static List <ProductSizeModel> GetSizesByColorAndSizeCategory(String code, String color, String category)
 {
     using (var client = new LandauPortalWebAPI())
     {
         return(GetSizesByColorAndSizeCategory(code, color, category, client));
     }
 }
Exemple #6
0
 public static ProductDetailModel GetProductDetailModel(String code)
 {
     using (var client = new LandauPortalWebAPI())
     {
         return(GetProductDetailModel(code, client));
     }
 }
Exemple #7
0
        public static bool Create(GroupModel groupModel)
        {
            using (var client = new LandauPortalWebAPI())
            {
                var groupOrder = new GroupOrder();

                //Group
                groupOrder.Brand = groupModel.Brand;
                //Group Inquiry
                setInquiry(groupOrder, groupModel);
                //Group Purchase
                setPurchase(groupOrder, groupModel);
                //Group Necessity
                setNecessity(groupOrder, groupModel);
                //Group
                groupOrder.Comments  = groupModel.Comments;
                groupOrder.EntryDate = DateTime.Now;

                try
                {
                    String result = client.GroupOrders.Create(groupOrder.Brand, groupOrder);
                    return(true);
                }
                catch (Exception e)
                {
                    if (e is HttpOperationException)
                    {
                        var httpEx = (HttpOperationException)e;
                        return(httpEx.Response.IsSuccessStatusCode);
                    }
                }
                return(false);
            }
        }
        public static bool EmailFavs(FavoritesEmailModel favModel)
        {
            using (var client = new LandauPortalWebAPI())
            {
                var emailFav = new EmailFavorite()
                {
                    Brand          = favModel.Brand,
                    EntryDate      = DateTime.Now,
                    Message        = favModel.Message,
                    RecipientEmail = favModel.RecipientEmail,
                    RecipientName  = favModel.RecipientName,
                    SenderName     = favModel.FullName,
                    Subject        = favModel.Subject,
                    Products       = favModel.FavProds != null?favModel.FavProds.Distinct().ToList() : null
                };

                try
                {
                    client.EmailFavorites.Create(favModel.Brand, emailFav);
                    return(true);
                }
                catch (Exception e)
                {
                    if (e is HttpOperationException)
                    {
                        var httpEx = (HttpOperationException)e;
                        return(httpEx.Response.IsSuccessStatusCode);
                    }
                }
                return(false);
            }
        }
        public static bool Create(FaqModel faqModel)
        {
            using (var client = new LandauPortalWebAPI())
            {
                var question = new Question();

                question.Brand     = faqModel.Brand;
                question.FirstName = faqModel.FirstName;
                question.LastName  = faqModel.LastName;
                question.Phone     = faqModel.Phone;
                question.Email     = faqModel.Email;
                question.Comments  = faqModel.Comments;

                try
                {
                    client.Questions.CreateQuestions(question.Brand, question);
                    return(true);
                }
                catch (Exception e)
                {
                    if (e is HttpOperationException)
                    {
                        var httpEx = (HttpOperationException)e;
                        return(httpEx.Response.IsSuccessStatusCode);
                    }
                }

                return(false);
            }
        }
Exemple #10
0
        private static ProductDetailModel GetProductDetailModel(String code, LandauPortalWebAPI client)
        {
            var prod = client.Products.GetByProduct(code);

            var detail = new ProductDetailModel(prod.ProductCode, prod.ProductName, prod.ProductDescription, prod.Image != null ? prod.Image.CatalogImageUri : null, prod.Image != null ? prod.Image.ColorCode : null, prod.Breadcrumb != null ? prod.Breadcrumb.Gender : null, prod.Breadcrumb != null && prod.Breadcrumb.Category != null ? prod.Breadcrumb.Collection : null, prod.Breadcrumb != null ? prod.Breadcrumb.Category : null, prod.Seo.PageTitle, prod.Seo.MetaDescription, prod.FitRiseWaist);

            return(detail);
        }
 public static Models.Seo GetSeoInformation(string brand, string pageName)
 {
     using (var client = new LandauPortalWebAPI())
     {
         var info = client.Seo.GetByBrandAndPageName(brand, pageName);
         return(info);
     }
 }
        private static List <DropDownModel> GetSortOptions(LandauPortalWebAPI client, string brand)
        {
            var obs = client.Catalogs.GetAllSortByByBrand(brand);

            return(obs.Results.Select(s => new DropDownModel()
            {
                Name = s.Key, Value = s.Value
            }).ToList());
        }
        private static List <DropDownModel> GetSizes(LandauPortalWebAPI client, string gender)
        {
            var obs = client.Catalogs.GetAllSizeByGender(gender);

            return(obs.Results.Select(s => new DropDownModel()
            {
                Name = s.Key, Value = s.Value
            }).ToList());
        }
Exemple #14
0
        private static List <DropDownModel> GetCategories(LandauPortalWebAPI client, string brand, string gender, bool filterDisplay = true)
        {
            var obs = client.Catalogs.GetAllCategoryByBrand(brand, gender);

            return(obs.Results.Where(d => !filterDisplay || (d.Display.HasValue && d.Display.Value)).Select(s => new DropDownModel()
            {
                Name = s.Key, Value = s.Value
            }).ToList());
        }
Exemple #15
0
        public static DropDownModel GetCollectionByName(string brand, string name, string gender)
        {
            using (var client = new LandauPortalWebAPI())
            {
                var obj = GetCollections(client, brand, gender).Where(c => UrlBuilder.GenerateSlug(c.Value) == name || c.Value.ToLower() == name.ToLower()).FirstOrDefault();

                return(obj);
            }
        }
Exemple #16
0
        public static ProductListModel GetProducts(HttpSessionStateBase session, ProductListFilter filter)
        {
            using (var client = new LandauPortalWebAPI())
            {
                var prods = client.Catalogs.GetProductsAsync(filter.Brand,
                                                             filter.Gender,
                                                             filter.Collection,
                                                             filter.Category,
                                                             filter.IsNew,
                                                             filter.Fit,
                                                             filter.Size,
                                                             filter.Color,
                                                             filter.Sort,
                                                             filter.PageNumber,
                                                             filter.ViewAll ? 999999 : new int?(PAGE_SIZE));

                var prdList = new ProductListModel();
                prdList.Products = prods.Results.Select(p => new ProductModel()
                {
                    Code = p.ProductCode, Image = p.ImageUri, Name = p.ProductName, IsNew = p.IsNew ?? false, HasNewColors = p.HasNewColor ?? false
                }).ToList();
                prdList.Pagination.CurrentPage = prods.Pagination.CurrentPage ?? 0;
                prdList.Pagination.PageCount   = prods.Pagination.TotalPages ?? 0;
                prdList.Pagination.PageSize    = prods.Pagination.PageSize ?? 0;
                prdList.CatalogImage           = prods.CatalogImageUri;

                if (prods.TextSlider != null)
                {
                    prdList.SliderText.Title        = prods.TextSlider.Title;
                    prdList.SliderText.Descriptions = prods.TextSlider.Descriptions.OrderBy(o => o.SortOrder).Select(d => d.Description).ToList();
                }

                if (prods.Seo != null)
                {
                    prdList.Seo.PageDescription = prods.Seo.MetaDescription;
                    prdList.Seo.PageTitle       = prods.Seo.PageTitle;
                }

                if (prods.Filters != null)
                {
                    var ftls = prods.Filters.Select(f => f.ToLower()).ToList();
                    prdList.FilterDisplay.DisplaySizeFilter  = ftls.Contains("size");
                    prdList.FilterDisplay.DisplayColorFilter = ftls.Contains("color");
                    prdList.FilterDisplay.DisplaySort        = ftls.Contains("sort by");
                    prdList.FilterDisplay.DisplayFitFilter   = ftls.Contains("fit type");
                }

                var result = new ProductSearchResult()
                {
                    Filter = filter, Result = prdList
                };

                session[CATALOG_SEARCH_PRODS] = result;

                return(prdList);
            }
        }
Exemple #17
0
        public static Double GetProductReviewAverage(String code)
        {
            using (var client = new LandauPortalWebAPI())
            {
                var reviews = client.ProductReviews.GetAllByProduct(code, 1, 1);

                return(reviews.Average ?? 0);
            }
        }
Exemple #18
0
 public static List <OnlineRetailModel> GetAllOnlineByBrand(string brand)
 {
     using (var client = new LandauPortalWebAPI())
     {
         var countries = client.Retailers.GetAllOnlineByBrand(brand, true);
         return(countries.Results.Select(x => new OnlineRetailModel()
         {
             ImageUri = x.ImageUri, LandauSiteUrl = x.LandauSiteUrl
         }).ToList());
     }
 }
Exemple #19
0
 private static List <ProductSizeModel> GetProductSizeModel(String code)
 {
     using (var client = new LandauPortalWebAPI())
     {
         var obs = client.Products.GetAllSizeByProduct(code);
         return(obs.Results.Select(s => new ProductSizeModel()
         {
             SizeCategory = s.SizeCategory, SizeCode = s.SizeCode
         }).ToList());
     }
 }
 public static List <StateModel> GetStateModelList()
 {
     using (var client = new LandauPortalWebAPI())
     {
         var obs = client.States.GetAll();
         return(obs.Results.Select(s => new StateModel()
         {
             Abbrev = s.Abbrev, Name = s.Name
         }).ToList());
     }
 }
 public static List <CountryModel> GetCountries()
 {
     using (var client = new LandauPortalWebAPI())
     {
         var countries = client.Countries.GetAll();
         return(countries.Results.Select(x => new CountryModel()
         {
             Code = x.CountryCode, Name = x.CountryName
         }).ToList());
     }
 }
Exemple #22
0
 public static List <OnlineRetailModel> GetAllBuyNow(string brand, string productCode)
 {
     using (var client = new LandauPortalWebAPI())
     {
         var retailers = client.Retailers.GetAllBuyNow(brand, productCode);
         return(retailers.Results.Select(x => new OnlineRetailModel()
         {
             ImageUri = x.ImageUri, LandauSiteUrl = x.SiteUri
         }).ToList());
     }
 }
Exemple #23
0
 public static List <IndustryModel> GetIndustryList(String brand)
 {
     using (var client = new LandauPortalWebAPI())
     {
         var obs = client.GroupOrders.GetAllIndustryByBrand(brand);
         List <IndustryModel> IndustryList = obs.Results.Select(s => new IndustryModel()
         {
             ID = (int)s.ID, Name = s.Name
         }).ToList();
         return(IndustryList);
     }
 }
Exemple #24
0
 public static List <OutfittedModel> GetOutfittedList(String brand)
 {
     using (var client = new LandauPortalWebAPI())
     {
         var obs = client.GroupOrders.GetAllNumberToBeOutfittedByBrand(brand);
         List <OutfittedModel> OutfittedModelList = obs.Results.Select(s => new OutfittedModel()
         {
             Key = s.Key, Value = s.Value
         }).ToList();
         return(OutfittedModelList);
     }
 }
Exemple #25
0
 public static CatalogSelectionModel GetSelectionModel(string brand)
 {
     using (var client = new LandauPortalWebAPI())
     {
         var selections = new CatalogSelectionModel();
         selections.WomenCategories  = GetCategories(client, brand, Constants.WOMEN_GENDER);
         selections.WomenCollections = GetCollections(client, brand, Constants.WOMEN_GENDER);
         selections.MenCategories    = GetCategories(client, brand, Constants.MEN_GENDER);
         selections.MenCollections   = GetCollections(client, brand, Constants.MEN_GENDER);
         return(selections);
     }
 }
 public static FilterModel GetFilterModel(string brand, string gender)
 {
     using (var client = new LandauPortalWebAPI())
     {
         var filter = new FilterModel();
         filter.Sizes    = GetSizes(client, gender);
         filter.FitTypes = GetFitTypes(client, brand);
         filter.Colors   = GetColors(client, brand);
         filter.SortBy   = GetSortOptions(client, brand);
         return(filter);
     }
 }
        public static SeoModel GetReviewSeo(string code)
        {
            using (var client = new LandauPortalWebAPI())
            {
                var seoInfo = client.ProductReviews.GetAllByProduct(code, 1, 1);

                return(new SeoModel()
                {
                    PageTitle = seoInfo.Seo.PageTitle, PageDescription = seoInfo.Seo.MetaDescription
                });
            }
        }
Exemple #28
0
        private static List <ProductColorModel> GetProductColorModel(String code, LandauPortalWebAPI client)
        {
            var obs = client.Products.GetAllColorByProduct(code);

            return(obs.Results.Select(s => new ProductColorModel()
            {
                ColorCode = s.ColorCode,
                ColorName = s.ColorName,
                PrimaryHex = s.PrimaryHex,
                SecondaryHex = s.SecondaryHex,
                SwatchType = s.SwatchType,
                ColorImageUrl = s.PrintImageUri
            }).ToList());
        }
Exemple #29
0
        public static RetailListModel GetByBrand(string brand)
        {
            var model = new RetailListModel();

            if (!string.IsNullOrEmpty(brand))
            {
                using (var client = new LandauPortalWebAPI())
                {
                    var retailers = client.Retailers.GetAllOnlineByBrand(brand);
                    model.Retailers = retailers.Results.Select(x => toRetailModel(x)).ToList();
                }
            }
            return(model);
        }
Exemple #30
0
 public static Product FindProduct(string code)
 {
     using (var client = new LandauPortalWebAPI())
     {
         try
         {
             var result = client.Products.GetByProduct(code);
             return(result);
         }
         catch (Exception)
         {
             return(null);
         }
     }
 }