public ActionResult Edit([Bind(Include = "MaGD,MaKH,NgayGD,NgayHetHan,SoTien,NguoiThu")] LichSuGD lichsugd) { if (ModelState.IsValid) { db.Entry(lichsugd).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MaKH = new SelectList(db.DSKhachHang, "MaKH", "TenKH", lichsugd.MaKH); return(View(lichsugd)); }
public ActionResult Paid(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var gd = db.DSLichSuGD.Find(id); if (gd == null) { return(HttpNotFound()); } if (ModelState.IsValid) { gd.Paid = true; db.Entry(gd).State = EntityState.Modified; db.SaveChanges(); return(Json(true)); } return(Json(false)); }