public ActionResult DeleteConfirmed(int id) { StaffParamType staffParamType = db.StaffParamTypes.Find(id); db.StaffParamTypes.Remove(staffParamType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name")] StaffParamType staffParamType) { if (ModelState.IsValid) { StaffParamType staffParam = db.StaffParamTypes.Find(staffParamType.Id); staffParam.ChangePerson = this.Name; staffParam.ChangeTime = DateTime.Now; staffParam.Name = staffParamType.Name; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(staffParamType)); }
public ActionResult Create([Bind(Include = "Id,Name")] StaffParamType staffParamType) { if (ModelState.IsValid) { staffParamType.RecordPerson = this.Name; staffParamType.RecordTime = DateTime.Now; db.StaffParamTypes.Add(staffParamType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(staffParamType)); }
// GET: StaffParamTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StaffParamType staffParamType = db.StaffParamTypes.Find(id); if (staffParamType == null) { return(HttpNotFound()); } return(View(staffParamType)); }