Example #1
0
        public async Task <ActionResult> DeleteConfirmed(long id)
        {
            CapDau capDau = await db.CapDaus.FindAsync(id);

            db.CapDaus.Remove(capDau);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Example #2
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));
        }
Example #3
0
        // GET: Admin/CapDaus/Details/5
        public async Task <ActionResult> Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CapDau capDau = await db.CapDaus.FindAsync(id);

            if (capDau == null)
            {
                return(HttpNotFound());
            }
            return(View(capDau));
        }
Example #4
0
        // GET: Admin/CapDaus/Edit/5
        public async Task <ActionResult> Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CapDau capDau = await db.CapDaus.FindAsync(id);

            if (capDau == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IDclbNha   = new SelectList(db.CLBs, "IDclb", "TenClb", capDau.IDclbNha);
            ViewBag.IDclbKhach = new SelectList(db.CLBs, "IDclb", "TenClb", capDau.IDclbKhach);
            return(View(capDau));
        }
Example #5
0
 public long Insert(CapDau entity)
 {
     db.CapDaus.Add(entity);
     db.SaveChanges();
     return(entity.ID_capdau);
 }