Пример #1
0
        public ActionResult DeleteConfirmed(decimal id)
        {
            DotKhoaLuan dotKhoaLuan = db.DotKhoaLuans.Find(id);

            db.DotKhoaLuans.Remove(dotKhoaLuan);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "DotKhoaLuanId,TenDotKhoaLuan,NamHocHocKyId")] DotKhoaLuan dotKhoaLuan)
 {
     if (ModelState.IsValid)
     {
         db.Entry(dotKhoaLuan).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.NamHocHocKyId = new SelectList(db.NamHocs, "NamHocHocKyId", "TenNamHocHocKy", dotKhoaLuan.NamHocHocKyId);
     ViewBag.DotKhoaLuanId = new SelectList(db.QuanLyLiches, "DotKhoaLuanId", "TieuDe", dotKhoaLuan.DotKhoaLuanId);
     return(View(dotKhoaLuan));
 }
Пример #3
0
 // GET: DotKhoaLuan/Details/5
 public ActionResult Details(decimal id)
 {
     if (!UserManager.Authenticated)
     {
         return(RedirectToAction("Login", "Admin"));
     }
     else
     {
         if (id == null)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         DotKhoaLuan dotKhoaLuan = db.DotKhoaLuans.Find(id);
         if (dotKhoaLuan == null)
         {
             return(HttpNotFound());
         }
         return(View(dotKhoaLuan));
     }
 }
Пример #4
0
 // GET: DotKhoaLuan/Edit/5
 public ActionResult Edit(decimal id)
 {
     if (!UserManager.Authenticated)
     {
         return(RedirectToAction("Login", "Admin"));
     }
     else
     {
         if (id == 0)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         DotKhoaLuan dotKhoaLuan = db.DotKhoaLuans.Find(id);
         if (dotKhoaLuan == null)
         {
             return(HttpNotFound());
         }
         ViewBag.NamHocHocKyId = new SelectList(db.NamHocs, "NamHocHocKyId", "TenNamHocHocKy", dotKhoaLuan.NamHocHocKyId);
         ViewBag.DotKhoaLuanId = new SelectList(db.QuanLyLiches, "DotKhoaLuanId", "TieuDe", dotKhoaLuan.DotKhoaLuanId);
         return(View(dotKhoaLuan));
     }
 }