コード例 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            LecturerSet lecturerSet = await db.LecturerSet.FindAsync(id);

            db.LecturerSet.Remove(lecturerSet);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public async Task <ActionResult> Edit(LecturerSet lecturerSet)
        {
            if (ModelState.IsValid)
            {
                db.Entry(lecturerSet).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(lecturerSet));
        }
コード例 #3
0
        public async Task <ActionResult> Create(LecturerSet lecturerSet)
        {
            if (ModelState.IsValid)
            {
                db.LecturerSet.Add(lecturerSet);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(lecturerSet));
        }
コード例 #4
0
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LecturerSet lecturerSet = await db.LecturerSet.FindAsync(id);

            if (lecturerSet == null)
            {
                return(HttpNotFound());
            }
            return(View(lecturerSet));
        }