コード例 #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            School_Class account = db.School_Class.Find(id);

            LogManager.createlog("delete", account.ToString());
            School_Class school_Class = db.School_Class.Find(id);

            db.School_Class.Remove(school_Class);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult Create([Bind(Include = "Class_Number,Profile,Employee_Id")] School_Class school_Class)
        {
            LogManager.createlog("create", school_Class.ToString());
            if (ModelState.IsValid)
            {
                db.School_Class.Add(school_Class);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Employee_Id  = new SelectList(db.Employee, "Employee_ID", "First_Name", school_Class.Employee_Id);
            ViewBag.Class_Number = new SelectList(db.Lesson, "Class_Number", "Subject_Name", school_Class.Class_Number);
            return(View(school_Class));
        }