Пример #1
0
        public async Task <ActionResult> DeleteConfirmed(string id)
        {
            TruongNganhMonthi truongNganhMonthi = await db.TruongNganhMonthis.FindAsync(id);

            db.TruongNganhMonthis.Remove(truongNganhMonthi);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Пример #2
0
        public async Task <ActionResult> Edit([Bind(Include = "MaTruong,MaNganh,idMon1,idMon2,idMon3,Nam,Diem,SoLuongTruyCap")] TruongNganhMonthi truongNganhMonthi)
        {
            if (ModelState.IsValid)
            {
                db.Entry(truongNganhMonthi).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.MaNganh  = new SelectList(db.Nganhs, "MaNganh", "Ten", truongNganhMonthi.MaNganh);
            ViewBag.MaTruong = new SelectList(db.Truongs, "MaTruong", "Ten", truongNganhMonthi.MaTruong);
            return(View(truongNganhMonthi));
        }
Пример #3
0
        // GET: TruongNganhMonthis/Details/5
        public async Task <ActionResult> Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TruongNganhMonthi truongNganhMonthi = await db.TruongNganhMonthis.FindAsync(id);

            if (truongNganhMonthi == null)
            {
                return(HttpNotFound());
            }
            return(View(truongNganhMonthi));
        }
Пример #4
0
        // GET: TruongNganhMonthis/Edit/5
        public async Task <ActionResult> Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TruongNganhMonthi truongNganhMonthi = await db.TruongNganhMonthis.FindAsync(id);

            if (truongNganhMonthi == null)
            {
                return(HttpNotFound());
            }
            ViewBag.MaNganh  = new SelectList(db.Nganhs, "MaNganh", "Ten", truongNganhMonthi.MaNganh);
            ViewBag.MaTruong = new SelectList(db.Truongs, "MaTruong", "Ten", truongNganhMonthi.MaTruong);
            return(View(truongNganhMonthi));
        }