public ActionResult DeleteConfirmed(int id) { ChiTietPhieuBanHang chiTietPhieuBanHang = db.ChiTietPhieuBanHangs.Find(id); db.ChiTietPhieuBanHangs.Remove(chiTietPhieuBanHang); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "SoPhieuBanHang,MaHangHoa,SoLuong,Gia,ThanhTien")] ChiTietPhieuBanHang chiTietPhieuBanHang) { if (ModelState.IsValid) { db.Entry(chiTietPhieuBanHang).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MaHangHoa = new SelectList(db.HangHoas, "MaHangHoa", "TenHangHoa", chiTietPhieuBanHang.MaHangHoa); ViewBag.SoPhieuBanHang = new SelectList(db.PhieuBanHangs, "SoPhieuBanHang", "TenKhachHang", chiTietPhieuBanHang.SoPhieuBanHang); return(View(chiTietPhieuBanHang)); }
// GET: ChiTietPhieuBanHang/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ChiTietPhieuBanHang chiTietPhieuBanHang = db.ChiTietPhieuBanHangs.Find(id); if (chiTietPhieuBanHang == null) { return(HttpNotFound()); } return(View(chiTietPhieuBanHang)); }
// GET: ChiTietPhieuBanHang/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ChiTietPhieuBanHang chiTietPhieuBanHang = db.ChiTietPhieuBanHangs.Find(id); if (chiTietPhieuBanHang == null) { return(HttpNotFound()); } ViewBag.MaHangHoa = new SelectList(db.HangHoas, "MaHangHoa", "TenHangHoa", chiTietPhieuBanHang.MaHangHoa); ViewBag.SoPhieuBanHang = new SelectList(db.PhieuBanHangs, "SoPhieuBanHang", "TenKhachHang", chiTietPhieuBanHang.SoPhieuBanHang); return(View(chiTietPhieuBanHang)); }
public async Task Delete(object deleteModel) { ChiTietPhieuBanHang xoaPhieuBanHang = (ChiTietPhieuBanHang)deleteModel; await _chiTietPhieuBanHangRepo.DeleteAsync(xoaPhieuBanHang); }