コード例 #1
0
 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));
 }
コード例 #2
0
        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));
        }