Esempio n. 1
0
        // GET: Products/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var result = service.CreateLoginSession("Sazi", "Password0");

            var product = service.GetAvailableProductsByProductId(result.OnLineOrderLoginSesssionKey, id.Value);

            if (product.GetProduct == null)
            {
                ViewBag.Error = "Not Found";
                return(HttpNotFound());
            }
            return(View(MapServiceMVC.MapOnLineOrderRequestProduct(product.GetProduct)));
        }
Esempio n. 2
0
        // GET: Products
        public ActionResult Index()
        {
            var result = service.CreateLoginSession("Sazi", "Password0");

            if (result.Errors.Count() == 0)
            {
                var products = service.GetAllAvailableProducts(result.OnLineOrderLoginSesssionKey);
                return(View(MapServiceMVC.MapOnLineOrderRequest(products.GetAllProducts)));
            }
            else
            {
                foreach (var errorMassage in result.Errors)
                {
                    ViewData["students"] = errorMassage.ErrorCode + " - " + errorMassage.ErrorDescription + "<br/>";
                }

                return(View(ViewData["students"]));
            }
        }