Example #1
0
        // GET: ShoesForSale/Edit/5 (DONE)
        public ActionResult Edit(int id)
        {
            ShoesForSale shoesForSale = context.ZapatosParaVenda.Find(id);

            if (shoesForSale == null)
            {
                return(HttpNotFound());
            }
            return(View(shoesForSale));
        }
Example #2
0
        public ActionResult Create(ShoesForSale shoesForSale)
        {
            if (ModelState.IsValid)
            {
                context.ZapatosParaVenda.Add(shoesForSale);
                context.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(shoesForSale));
        }
Example #3
0
        public ActionResult Edit(int id, ShoesForSale shoesForSale)
        {
            try
            {
                var ShoesForSaleInDb = context.ZapatosParaVenda.Where(s => s.Id == shoesForSale.Id).SingleOrDefault();
                ShoesForSaleInDb.BrandofShoeForSale = shoesForSale.BrandofShoeForSale;
                ShoesForSaleInDb.NameOfShoe         = shoesForSale.NameOfShoe;
                ShoesForSaleInDb.CondiciondeZapatos = shoesForSale.CondiciondeZapatos;
                ShoesForSaleInDb.GetShoeSizeForSale = shoesForSale.GetShoeSizeForSale;
                ShoesForSaleInDb.ShoePrice          = shoesForSale.ShoePrice;
                context.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #4
0
        // GET: ShoesForSale/Create (DONE)
        public ActionResult Create()
        {
            ShoesForSale shoesForSale = new ShoesForSale();

            return(View(shoesForSale));
        }
Example #5
0
        // GET: ShoesForSale/Details/5 (Done)
        public ActionResult Details(int id)
        {
            ShoesForSale shoesForSale = context.ZapatosParaVenda.Where(z => z.Id == id).Single();

            return(View(shoesForSale));
        }