Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(string id)
        {
            Chude chude = db.Chudes.Find(id);

            db.Chudes.Remove(chude);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult ThemChuDe(string TenChuDe)
        {
            Chude cd = new Chude();

            cd.Tenchude = TenChuDe;
            db.Chudes.Add(cd);
            db.SaveChanges();
            return(RedirectToAction("ThemSach"));
        }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "machude,tenchude")] Chude chude)
 {
     if (ModelState.IsValid)
     {
         db.Entry(chude).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(chude));
 }
Ejemplo n.º 4
0
        public ActionResult Create([Bind(Include = "machude,tenchude")] Chude chude)
        {
            if (ModelState.IsValid)
            {
                db.Chudes.Add(chude);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(chude));
        }
Ejemplo n.º 5
0
        // GET: Chudes/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Chude chude = db.Chudes.Find(id);

            if (chude == null)
            {
                return(HttpNotFound());
            }
            return(View(chude));
        }
Ejemplo n.º 6
0
 public static bool Chude_Update(Chude data)
 {
     return(db.Chude_Update(data));
 }
Ejemplo n.º 7
0
 public static bool Chude_Insert(Chude data)
 {
     return(db.Chude_Insert(data));
 }