Exemplo n.º 1
0
        public async Task <ActionResult> Edit([Bind(Include = "ID_capdau,IDclbNha,IDclbKhach")] CapDau capDau)
        {
            if (ModelState.IsValid)
            {
                db.Entry(capDau).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.IDclbNha   = new SelectList(db.CLBs, "IDclb", "TenClb", capDau.IDclbNha);
            ViewBag.IDclbKhach = new SelectList(db.CLBs, "IDclb", "TenClb", capDau.IDclbKhach);
            return(View(capDau));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Edit([Bind(Include = "IDCapdau,IDLich,KetQua")] LichCapDau lichCapDau)
        {
            if (ModelState.IsValid)
            {
                db.Entry(lichCapDau).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.IDCapdau = new SelectList(db.CapDaus, "ID_capdau", "ID_capdau", lichCapDau.IDCapdau);
            ViewBag.IDLich   = new SelectList(db.Liches, "ID_lich", "NgayDau", lichCapDau.IDLich);
            return(View(lichCapDau));
        }