Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            LoaiT loaiT = db.LoaiTS.Find(id);

            db.LoaiTS.Remove(loaiT);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "MaLTS,TenLTS")] LoaiT loaiT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(loaiT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(loaiT));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "MaLTS,TenLTS")] LoaiT loaiT)
        {
            if (ModelState.IsValid)
            {
                db.LoaiTS.Add(loaiT);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(loaiT));
        }
Пример #4
0
        // GET: LoaiTS/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LoaiT loaiT = db.LoaiTS.Find(id);

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