コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            WorkerEducation workerEducation = db.WorkerEducations.Find(id);

            db.WorkerEducations.Remove(workerEducation);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "WorkerEducationId,WorkerId,UniversityId,EducationStart,EducationEnd,EducationSpecialtyId")] WorkerEducation workerEducation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(workerEducation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EducationSpecialtyId = new SelectList(db.EducationSpecialties, "EducationSpecialtyId", "EducationSpecialtyName", workerEducation.EducationSpecialtyId);
     ViewBag.UniversityId         = new SelectList(db.Universities, "UniversityId", "UniversityName", workerEducation.UniversityId);
     ViewBag.WorkerId             = new SelectList(db.Workers, "WorkerId", "WorkerName", workerEducation.WorkerId);
     return(View(workerEducation));
 }
コード例 #3
0
        // GET: WorkerEducations/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WorkerEducation workerEducation = db.WorkerEducations.Find(id);

            if (workerEducation == null)
            {
                return(HttpNotFound());
            }
            return(View(workerEducation));
        }
コード例 #4
0
        // GET: WorkerEducations/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WorkerEducation workerEducation = db.WorkerEducations.Find(id);

            if (workerEducation == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EducationSpecialtyId = new SelectList(db.EducationSpecialties, "EducationSpecialtyId", "EducationSpecialtyName", workerEducation.EducationSpecialtyId);
            ViewBag.UniversityId         = new SelectList(db.Universities, "UniversityId", "UniversityName", workerEducation.UniversityId);
            ViewBag.WorkerId             = new SelectList(db.Workers, "WorkerId", "WorkerName", workerEducation.WorkerId);
            return(View(workerEducation));
        }