コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PhieuHoaDon phieuHoaDon = db.PhieuHoaDons.Find(id);

            db.PhieuHoaDons.Remove(phieuHoaDon);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "IDphieu,MaPhieu,TenPhieu,SanPham")] PhieuHoaDon phieuHoaDon)
 {
     if (ModelState.IsValid)
     {
         db.Entry(phieuHoaDon).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(phieuHoaDon));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "IDphieu,MaPhieu,TenPhieu,SanPham")] PhieuHoaDon phieuHoaDon)
        {
            if (ModelState.IsValid)
            {
                db.PhieuHoaDons.Add(phieuHoaDon);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(phieuHoaDon));
        }
コード例 #4
0
        // GET: PhieuHoaDons/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PhieuHoaDon phieuHoaDon = db.PhieuHoaDons.Find(id);

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