public async Task <ActionResult> Create(Psychomotor model) { if (ModelState.IsValid) { var psychomotor = new Psychomotor() { StudentId = model.StudentId, TermName = model.TermName.ToString(), SessionName = model.SessionName, ClassName = model.ClassName, Sports = model.Sports.ToString(), ExtraCurricularActivity = model.ExtraCurricularActivity.ToString(), Assignment = model.Assignment.ToString(), HelpingOthers = model.HelpingOthers.ToString(), ManualDuty = model.ManualDuty.ToString(), LevelOfCommitment = model.LevelOfCommitment.ToString() }; Db.Psychomotors.Add(psychomotor); await Db.SaveChangesAsync(); return(RedirectToAction("FormTeacher", "Classes")); } return(View(model)); }
public async Task <ActionResult> Edit([Bind(Include = "Id,StudentId,TermName,SessionName,ClassName,Sports,ExtraCurricularActivity,Assignment,HelpingOthers,ManualDuty,LevelOfCommitment")] Psychomotor psychomotor) { if (ModelState.IsValid) { Db.Entry(psychomotor).State = EntityState.Modified; await Db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(psychomotor)); }
public async Task <ActionResult> DeleteConfirmed(int id) { Psychomotor psychomotor = await Db.Psychomotors.FindAsync(id); if (psychomotor != null) { Db.Psychomotors.Remove(psychomotor); } await Db.SaveChangesAsync(); return(RedirectToAction("Index")); }
// GET: Psychomotors/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Psychomotor psychomotor = await Db.Psychomotors.FindAsync(id); if (psychomotor == null) { return(HttpNotFound()); } return(View(psychomotor)); }