public ActionResult DeleteConfirmed(int projectId, int workerId) { WORKTIME worktime = db.WORKTIMEs.Find(projectId, workerId); db.WORKTIMEs.Remove(worktime); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /WORKTIMEs/Details/5 public ActionResult Details(int projectId, int workerId) { WORKTIME worktime = db.WORKTIMEs.Find(projectId, workerId); if (worktime == null) { return(HttpNotFound()); } return(View(worktime)); }
public ActionResult Edit(WORKTIME worktime) { if (ModelState.IsValid) { db.Entry(worktime).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.projectId = new SelectList(db.PROJECTs, "Id", "Name", worktime.projectId); ViewBag.workerId = new SelectList(db.WORKERs, "Id", "firstName", worktime.workerId); return(View(worktime)); }
// // GET: /WORKTIMEs/Edit/5 public ActionResult Edit(int projectId, int workerId) { WORKTIME worktime = db.WORKTIMEs.Find(projectId, workerId); if (worktime == null) { return(HttpNotFound()); } ViewBag.projectId = new SelectList(db.PROJECTs, "Id", "Name", worktime.projectId); ViewBag.workerId = new SelectList(db.WORKERs, "Id", "firstName", worktime.workerId); return(View(worktime)); }
public ActionResult Create(WORKTIME worktime) { if (ModelState.IsValid) { WORKTIME w = db.WORKTIMEs.Find(worktime.projectId, worktime.workerId); if (w == null) { db.WORKTIMEs.Add(worktime); db.SaveChanges(); return(RedirectToAction("Index")); } return(RedirectToAction("Create")); } ViewBag.projectId = new SelectList(db.PROJECTs, "Id", "Name", worktime.projectId); ViewBag.workerId = new SelectList(db.WORKERs, "Id", "firstName", worktime.workerId); return(View(worktime)); }