示例#1
0
        //
        // GET: /Order/Details/5
        public ActionResult Details(int id)
        {
            var resp = op.Find(id);

            ViewBag.order = resp;
            var states = Enum.GetValues(typeof(State)).Cast <State>().ToList();
            Dictionary <int, string> mapIdNameStates = new Dictionary <int, string>();
            int i = 1;

            foreach (State state in states)
            {
                mapIdNameStates.Add(i, state.ToString());
                i++;
            }
            Dictionary <int, string> mapIdNameProducts = new Dictionary <int, string>();

            foreach (ASF.Entities.OrderDetail detail in resp.Details)
            {
                var product = pp.Find(detail.ProductId);
                mapIdNameProducts.Add(product.Id, product.Title);
            }
            ViewBag.states   = mapIdNameStates;
            ViewBag.products = mapIdNameProducts;

            return(View(resp));
        }
        // GET: Products/Details/5
        public ActionResult Details(int id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Product product = productProcess.Find(id);

            if (product == null)
            {
                return(HttpNotFound());
            }
            return(View(product));
        }
示例#3
0
        public ActionResult Create(int id)
        {
            var cookie = Request.Cookies[".AspNet.ApplicationCookie"].Value;
            var cp     = new CartProcess();
            var cart   = cp.Cookie(cookie);

            if (cart == null)
            {
                cp.Insert(new Cart()
                {
                    CartDate = DateTime.Now,
                    Cookie   = cookie
                });
                cart = cp.Cookie(cookie);
            }
            var pp  = new ProductProcess();
            var prd = pp.Find(id);

            ViewBag.Descripcion = prd.Description;
            ViewBag.Nombre      = prd.Title;
            ViewBag.Imagen      = prd.Image;
            ViewBag.Precio      = prd.Price;
            ViewBag.ProductId   = id;

            var item = new CartItem();

            item.CartId    = cart.Id;
            item.ProductId = id;
            item.Price     = prd.Price;
            item.Quantity  = 1;


            return(View(item));
        }
示例#4
0
        // GET: Products/Edit
        public ActionResult Edit(int id)
        {
            var pp  = new ProductProcess();
            var prd = pp.Find(id);

            return(View(prd));
        }
示例#5
0
        // GET: Products/Edit
        public ActionResult Edit(int id)
        {
            var pp  = new ProductProcess();
            var prd = pp.Find(id);

            var dp    = new DealerProcess();
            var lista = dp.SelectList();

            ViewData["Dealer"] = lista;

            return(View(prd));
        }
示例#6
0
        // GET: Products/Details
        public ActionResult Details(int id)
        {
            var pp  = new ProductProcess();
            var prd = pp.Find(id);

            var dp         = new DealerProcess();
            var descDealer = dp.Find(prd.DealerId);

            ViewData["Dealer"] = descDealer.FirstName + " " + descDealer.LastName;

            return(View(prd));
        }
示例#7
0
        // GET: OrderDetails/Details
        public ActionResult Details(int id)
        {
            var op        = new OrderDetailProcess();
            var orderItem = op.Find(id);

            var pp       = new ProductProcess();
            var descProd = pp.Find(orderItem.ProductId);

            ViewData["Product"] = descProd.Description;

            return(View(orderItem));
        }
示例#8
0
        // GET: Ratings/Details
        public ActionResult Details(int id)
        {
            var rp   = new RatingProcess();
            var rtng = rp.Find(id);

            var cp         = new ClientProcess();
            var descClient = cp.Find(rtng.ClientId);

            ViewData["Client"] = descClient.FirstName + " " + descClient.LastName;

            var pp       = new ProductProcess();
            var descProd = pp.Find(rtng.ProductId);

            ViewData["Product"] = descProd.Description;

            return(View(rtng));
        }
示例#9
0
        //[HttpPost]
        public PartialViewResult GetCart(string json)
        {
            dynamic result2   = JsonConvert.DeserializeObject(HttpUtility.HtmlDecode(Request.QueryString[0]));
            var     products  = new Dictionary <int, string>();
            var     listItems = new List <CartItem>();

            foreach (var i in result2.items)
            {
                var item    = new CartItem();
                var product = pprocess.Find((int)i.product);
                products.Add(product.Id, product.Title);

                item.Price     = product.Price;
                item.ProductId = product.Id;
                item.Quantity  = i.quantity;
                listItems.Add(item);
            }

            ViewBag.products  = products;
            ViewBag.listItems = listItems;

            return(PartialView("_rowTableCart"));//Json( new { foo="bar", baz="Blech" }, JsonRequestBehavior.AllowGet)
        }
示例#10
0
        //
        // GET: /Product/Product/Details/5
        public ActionResult Details(int id)
        {
            var resp = productProcess.Find(id);

            return(View(resp));
        }