Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            BoughtAsset boughtAsset = db.BoughtAssets.Find(id);

            db.BoughtAssets.Remove(boughtAsset);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,CreationDate")] BoughtAsset boughtAsset)
 {
     if (ModelState.IsValid)
     {
         db.Entry(boughtAsset).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(boughtAsset));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,CreationDate")] BoughtAsset boughtAsset)
        {
            if (ModelState.IsValid)
            {
                db.BoughtAssets.Add(boughtAsset);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(boughtAsset));
        }
Exemplo n.º 4
0
        // GET: BoughtAssets/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BoughtAsset boughtAsset = db.BoughtAssets.Find(id);

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