Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Tamung tamung = db.Tamungs.Find(id);

            db.Tamungs.Remove(tamung);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "MaNV,NgayTU,Sotien")] Tamung tamung)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tamung).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tamung));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "MaNV,NgayTU,Sotien")] Tamung tamung)
        {
            if (ModelState.IsValid)
            {
                db.Tamungs.Add(tamung);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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