Exemple #1
0
 public ActionResult Edit([Bind(Include = "myStockId,stock,currentPrice")] MyStocks myStocks)
 {
     if (ModelState.IsValid)
     {
         db.Entry(myStocks).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(myStocks));
 }
Exemple #2
0
        public ActionResult Create([Bind(Include = "myStockId,stock,currentPrice,symbol")] MyStocks myStocks)
        {
            if (ModelState.IsValid)
            {
                db.MyStocks.Add(myStocks);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(myStocks));
        }
Exemple #3
0
        // GET: MyStocks/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MyStocks myStocks = db.MyStocks.Find(id);

            if (myStocks == null)
            {
                return(HttpNotFound());
            }
            return(View(myStocks));
        }