Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            BoughtAsset boughtAsset = db.BoughtAssets.Find(id);

            db.BoughtAssets.Remove(boughtAsset);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #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));
 }
Beispiel #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));
        }
Beispiel #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));
        }