Exemple #1
0
        public ActionResult Create(FormCollection collection)
        {
            try
            {
               var productReview = reviewService.GetProductReview(collection["productId"]);
               if(productReview == null) {
                   productReview = new ProductReview();
                   productReview.ProductID = collection["productId"];
               }

               var review = new Review();

               review.FullComment = collection["comment"];
               review.DesignRating = double.Parse(collection["designRating"]);
               review.ValueRating = double.Parse(collection["valueRating"]);
               review.QualityRating = double.Parse(collection["qualityRating"]);
               review.UserNickname = "Anonymous";

               productReview.Reviews.Add(review);

               dynamic product = new ExpandoObject();
                product.ID = collection["productId"];
                var model = new PageModel() { Review = productReview, Product = product };
               reviewService.Save(productReview);

               return PartialView("Ajax/Index", model);
            }
            catch
            {
                return View();
            }
        }
Exemple #2
0
        //
        // GET: /Product/
        public ActionResult Index(string id)
        {
            Server.MapPath(@"~\Metadata\Solr\Asiana.xml");

            var response = searchService
                .Execute(new SolrQuery() { ID = id });

            dynamic document = response.Documents.FirstOrDefault();
            document.DeepZoomControlImages = Url.Content("~/Content/themes/base/seadragon");

            Basket basket = basketService.GetBasket();
            ProductReview productReview = reviewService.GetProductReview(id);

            XElement navigation = XElement.Load(Server.MapPath(@"~\MetaData\Navigation.xml"));

            var model = new PageModel() { Basket = basket, Product = document, TopNavigation = navigation, Review = productReview };

            if (Request.IsAjaxRequest())
            {
                return PartialView("Ajax/Index", model);
            }
            else
            {
                return View("Index", model);
            }
        }
Exemple #3
0
        public ActionResult Index(int pageSize, int page, string path)
        {
            var query = SolrNavigation.GetQueryFromSeoPath(path);
            query.PageSize = pageSize;
            query.Page = page - 1;

            var response = searchService
                .Execute(query);

            StringBuilder title = new StringBuilder();
            foreach(var item in response.BreadCrumb) {
                title.AppendFormat("{0} ",item.Value);
            }

            title.Append("| ");
            title.Append("Products at Fashinon");
            ViewBag.Title = title.ToString();

            Basket basket = basketService.GetBasket();

            XElement navigation = XElement.Load(Server.MapPath(@"~\MetaData\Navigation.xml"));

            var model = new PageModel() { Basket = basket, Response = response, TopNavigation=navigation};

            return View(model);
        }
Exemple #4
0
        //
        // GET: /Basket/
        public ActionResult Index()
        {
            Basket basket = basketService.GetBasket();

            XElement navigation = XElement.Load(Server.MapPath(@"~\MetaData\Navigation.xml"));

            var model = new PageModel() { Basket = basket, Response = null, TopNavigation = navigation };

            return View(model);
        }
Exemple #5
0
        public ActionResult Index()
        {
            var response = searchService
                .Execute(new SolrQuery());

            Basket basket = basketService.GetBasket();

            ViewBag.Title = "Fashinon - Fair Trade Hand Made Fashion for Everyone";

            XElement navigation = XElement.Load(Server.MapPath(@"~\MetaData\Navigation.xml"));

            var model = new PageModel() { Basket = basket, Response = response, TopNavigation = navigation };

            return View(model);
        }
Exemple #6
0
        public ActionResult IndexPost(string searchTerm)
        {
            var query = new SolrQuery() { SearchTerm = searchTerm };

            var response = searchService
                .Execute(query);

            Basket basket = basketService.GetBasket();

            XElement navigation = XElement.Load(Server.MapPath(@"~\MetaData\Navigation.xml"));

            var model = new PageModel() { Basket = basket, Response = response, TopNavigation = navigation };

            return View(model);
        }