Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MotoristaEntity motoristaEntity = db.MotoristaEntities.Find(id);

            db.MotoristaEntities.Remove(motoristaEntity);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Id,Nome,Cpf,Dt_Nascminento")] MotoristaEntity motoristaEntity)
 {
     if (ModelState.IsValid)
     {
         db.Entry(motoristaEntity).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(motoristaEntity));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "Id,Nome,Cpf,Dt_Nascminento")] MotoristaEntity motoristaEntity)
        {
            if (ModelState.IsValid)
            {
                db.MotoristaEntities.Add(motoristaEntity);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(motoristaEntity));
        }
Exemple #4
0
        // GET: Motorista/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MotoristaEntity motoristaEntity = db.MotoristaEntities.Find(id);

            if (motoristaEntity == null)
            {
                return(HttpNotFound());
            }
            return(View(motoristaEntity));
        }