private void WitnessDetailsLabel_Click(object sender, EventArgs e) { WitnessDetails witness = new WitnessDetails(); witness.MdiParent = this; witness.Show(); }
public ActionResult DeleteConfirmed(int id) { WitnessDetails witnessDetails = db.WitnessDetails.Find(id); db.WitnessDetails.Remove(witnessDetails); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,WitnessName,Age,Address,Phone,Gender,Email,RegistrationDate")] WitnessDetails witnessDetails) { if (ModelState.IsValid) { db.Entry(witnessDetails).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(witnessDetails)); }
public ActionResult Create([Bind(Include = "Id,WitnessName,Age,Address,Phone,Gender,Email,RegistrationDate")] WitnessDetails witnessDetails) { if (ModelState.IsValid) { db.WitnessDetails.Add(witnessDetails); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(witnessDetails)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WitnessDetails witnessDetails = db.WitnessDetails.Find(id); if (witnessDetails == null) { return(HttpNotFound()); } return(View(witnessDetails)); }