Example #1
0
        private void WitnessDetailsLabel_Click(object sender, EventArgs e)
        {
            WitnessDetails witness = new WitnessDetails();

            witness.MdiParent = this;
            witness.Show();
        }
Example #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            WitnessDetails witnessDetails = db.WitnessDetails.Find(id);

            db.WitnessDetails.Remove(witnessDetails);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #3
0
 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));
 }
Example #4
0
        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));
        }
Example #5
0
        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));
        }