public async Task <ActionResult> PT_XoaConfirmed(int id) { CTPhieuTT cTPhieuTT = await db.CTPhieuTTs.FindAsync(id); db.CTPhieuTTs.Remove(cTPhieuTT); await db.SaveChangesAsync(); return(RedirectToAction("PhieuThu")); }
public async Task <ActionResult> PT_Sua([Bind(Include = "SOCTPTT, SOPTT,MSMH,SoLuongBan,DonGia,ThanhTien")] CTPhieuTT cTPhieuTT) { if (ModelState.IsValid) { db.Entry(cTPhieuTT).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("PhieuThu")); } ViewBag.MSMH = new SelectList(db.MatHangs, "MSMH", "TenHang", cTPhieuTT.MSMH); ViewBag.SOPTT = new SelectList(db.PhieuThanhToans, "SOPTT", "TrangThai", cTPhieuTT.SOPTT); return(View(cTPhieuTT)); }
// GET: CTPhieuTTs/Delete/5 public async Task <ActionResult> PT_Xoa(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CTPhieuTT cTPhieuTT = await db.CTPhieuTTs.FindAsync(id); if (cTPhieuTT == null) { return(HttpNotFound()); } return(View(cTPhieuTT)); }
// GET: CTPhieuTTs/Edit/5 public async Task <ActionResult> Pt_Sua(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CTPhieuTT cTPhieuTT = await db.CTPhieuTTs.FindAsync(id); if (cTPhieuTT == null) { return(HttpNotFound()); } ViewBag.MSMH = new SelectList(db.MatHangs, "MSMH", "TenHang", cTPhieuTT.MSMH); ViewBag.SOPTT = new SelectList(db.PhieuThanhToans, "SOPTT", "TrangThai", cTPhieuTT.SOPTT); return(View(cTPhieuTT)); }