Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Daili daili = db.Dailis.Find(id);

            db.Dailis.Remove(daili);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "IdDL,TenDL,DiaChi,SDT")] Daili daili)
 {
     if (ModelState.IsValid)
     {
         db.Entry(daili).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(daili));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "IdDL,TenDL,DiaChi,SDT")] Daili daili)
        {
            if (ModelState.IsValid)
            {
                db.Dailis.Add(daili);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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