示例#1
0
        public ActionResult DeleteConfirmed(long id)
        {
            Despachos despachos = db.Despachos.Find(id);

            db.Despachos.Remove(despachos);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,Fecha,Tipo_de_accion,Cliente,contacto,Detalle_de_productos")] Despachos despachos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(despachos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(despachos));
 }
示例#3
0
 public ActionResult Edit([Bind(Include = "Id,Fecha,TipoDeAccion,IdCliente,Contacto,DetalleDeProductos")] Despachos despachos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(despachos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IdCliente = new SelectList(db.Clientes, "Id", "Codigo", despachos.IdCliente);
     return(View(despachos));
 }
        public ActionResult Create([Bind(Include = "Id,Fecha,Tipo_de_accion,Cliente,contacto,Detalle_de_productos")] Despachos despachos)
        {
            if (ModelState.IsValid)
            {
                db.Despachos.Add(despachos);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(despachos));
        }
示例#5
0
        // GET: Despachos/Details/5
        public ActionResult Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Despachos despachos = db.Despachos.Find(id);

            if (despachos == null)
            {
                return(HttpNotFound());
            }
            return(View(despachos));
        }
示例#6
0
        // GET: Despachos/Edit/5
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Despachos despachos = db.Despachos.Find(id);

            if (despachos == null)
            {
                return(HttpNotFound());
            }
            ViewBag.IdCliente = new SelectList(db.Clientes, "Id", "Codigo", despachos.IdCliente);
            return(View(despachos));
        }