// GET: ExternalTraining/Create public ActionResult Create() { var defaultTraining = new ExternalTraining(); defaultTraining.Cost = 350; return(View(defaultTraining)); }
public ActionResult DeleteConfirmed(int id) { ExternalTraining externalTraining = db.ExternalTrainings.Find(id); db.ExternalTrainings.Remove(externalTraining); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ExternalTrainingID,Name,type,TrainingDate,NumberOfMeetings,Duration,TrainingEnd,Location,Cost")] ExternalTraining externalTraining) { if (ModelState.IsValid) { db.Entry(externalTraining).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(externalTraining)); }
public ActionResult Create([Bind(Include = "ExternalTrainingID,Name,type,TrainingDate,NumberOfMeetings,Duration,TrainingEnd,Location,Cost")] ExternalTraining externalTraining, int[] Employees) { if (ModelState.IsValid) { db.ExternalTrainings.Add(externalTraining); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(externalTraining)); }
// GET: ExternalTraining/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ExternalTraining externalTraining = db.ExternalTrainings.Find(id); if (externalTraining == null) { return(HttpNotFound()); } return(View(externalTraining)); }