Esempio n. 1
0
        public JsonResult Delete(int id)
        {
            InfoKyHoc infoKyHoc = db.InfoKyHocs.Find(id);

            infoKyHoc.Status = "DELETE";
            return(Json(db.SaveChanges()));
        }
Esempio n. 2
0
        public JsonResult Status(int id, string status)
        {
            InfoKyHoc infoKyHoc = db.InfoKyHocs.Find(id);

            infoKyHoc.Status = status;
            return(Json(db.SaveChanges()));
        }
Esempio n. 3
0
        public ActionResult Edit(int?id)
        {
            InfoKyHoc infoKyHoc = db.InfoKyHocs.Find(id) ?? new InfoKyHoc()
            {
                Status = "INIT"
            };

            ViewBag.IDKyHocs  = new SelectList(db.KyHocs.Where(q => q.Active != false), "IDKyHoc", "TenHocKy", infoKyHoc.IDKyHoc);
            ViewBag.IDNamHocs = new SelectList(db.NamHocs.Where(q => q.Active != false), "IDNamHoc", "TenNamHoc", infoKyHoc.IDNamHoc);
            return(View(infoKyHoc));
        }
Esempio n. 4
0
 public ActionResult Edit(InfoKyHoc infoKyHoc)
 {
     if (infoKyHoc.IDInfoKyHoc > 0)
     {
         db.Entry(infoKyHoc).State = EntityState.Modified;
         db.SaveChanges();
     }
     else
     {
         db.InfoKyHocs.Add(infoKyHoc);
     }
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }