Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Despachador despachador = db.Despachadores.Find(id);

            despachador.Activo          = false;
            db.Entry(despachador).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "Id,Nombres,Apellidos,Activo")] Despachador despachador)
 {
     if (ModelState.IsValid)
     {
         db.Entry(despachador).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(despachador));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "Id,Nombres,Apellidos")] Despachador despachador)
        {
            despachador.Activo = true;
            if (ModelState.IsValid)
            {
                db.Trabajadores.Add(despachador);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(despachador));
        }
Example #4
0
        // GET: /Despachador/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Despachador despachador = db.Despachadores.Find(id);

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