public ActionResult DeleteConfirmed(int id) { Junction_EMP_TS junction_EMP_TS = db.Junction_EMP_TS.Find(id); db.Junction_EMP_TS.Remove(junction_EMP_TS); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "JETID,EMPID,TechServiceID,Percentage_Allocation")] Junction_EMP_TS junction_EMP_TS) { if (ModelState.IsValid) { db.Entry(junction_EMP_TS).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EMPID = new SelectList(db.Employees, "EMPID", "SurName", junction_EMP_TS.EMPID); ViewBag.TechServiceID = new SelectList(db.TechnologyServices, "TechServiceID", "ServiceName", junction_EMP_TS.TechServiceID); return(View(junction_EMP_TS)); }
// GET: Junction_EMP_TS/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Junction_EMP_TS junction_EMP_TS = db.Junction_EMP_TS.Find(id); if (junction_EMP_TS == null) { return(HttpNotFound()); } return(View(junction_EMP_TS)); }
// GET: Junction_EMP_TS/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Junction_EMP_TS junction_EMP_TS = db.Junction_EMP_TS.Find(id); if (junction_EMP_TS == null) { return(HttpNotFound()); } ViewBag.EMPID = new SelectList(db.Employees, "EMPID", "SurName", junction_EMP_TS.EMPID); ViewBag.TechServiceID = new SelectList(db.TechnologyServices, "TechServiceID", "ServiceName", junction_EMP_TS.TechServiceID); return(View(junction_EMP_TS)); }
// The create below also creates the new object named junction_emp_ts of type junction_emp_ts public ActionResult Create([Bind(Include = "JETID,EMPID,TechServiceID,Percentage_Allocation")] Junction_EMP_TS junction_EMP_TS) { // Trying to allow somebody to type in non decimal versions of a percentage if (junction_EMP_TS.Percentage_Allocation > 1) { junction_EMP_TS.Percentage_Allocation = junction_EMP_TS.Percentage_Allocation / 100; } // Call function to check Employee utilisation var TotalUtilisation = PerformCalcs.StoredProcedureRetDecimal("SumEmployeeSalary", junction_EMP_TS.EMPID); if (ModelState.IsValid) { db.Junction_EMP_TS.Add(junction_EMP_TS); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EMPID = new SelectList(db.Employees, "EMPID", "SurName", junction_EMP_TS.EMPID); ViewBag.TechServiceID = new SelectList(db.TechnologyServices, "TechServiceID", "ServiceName", junction_EMP_TS.TechServiceID); return(View(junction_EMP_TS)); }