Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            HatsTable hatsTable = db.HatsTables.Find(id);

            db.HatsTables.Remove(hatsTable);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "HatsID,NameHats,Type,Color,Season,Occasion,Photo")] HatsTable hatsTable)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hatsTable).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(hatsTable));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "HatsID,NameHats,Type,Color,Season,Occasion,Photo")] HatsTable hatsTable)
        {
            if (ModelState.IsValid)
            {
                db.HatsTables.Add(hatsTable);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(hatsTable));
        }
Exemple #4
0
        // GET: HatsTables/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HatsTable hatsTable = db.HatsTables.Find(id);

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