Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            WorkerProf workerProf = db.WorkerProfs.Find(id);

            db.WorkerProfs.Remove(workerProf);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "WorkerId,ProfId,StartWorkDate,QuitDate")] WorkerProf workerProf)
 {
     if (ModelState.IsValid)
     {
         db.Entry(workerProf).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProfId   = new SelectList(db.Profs, "IdProf", "ProfName", workerProf.ProfId);
     ViewBag.WorkerId = new SelectList(db.Workers, "IdWorker", "WorkerName", workerProf.WorkerId);
     return(View(workerProf));
 }
Exemplo n.º 3
0
        // GET: WorkerProfs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WorkerProf workerProf = db.WorkerProfs.Find(id);

            if (workerProf == null)
            {
                return(HttpNotFound());
            }
            return(View(workerProf));
        }
Exemplo n.º 4
0
        // GET: WorkerProfs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WorkerProf workerProf = db.WorkerProfs.Find(id);

            if (workerProf == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ProfId   = new SelectList(db.Profs, "IdProf", "ProfName", workerProf.ProfId);
            ViewBag.WorkerId = new SelectList(db.Workers, "IdWorker", "WorkerName", workerProf.WorkerId);
            return(View(workerProf));
        }