Example #1
0
        public ActionResult Create(Oferta oferta)
        {
            if (ModelState.IsValid)
            {
                db.Ofertas.Add(oferta);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.id_cliente = new SelectList(db.Clientes, "id_cliente", "pais", oferta.id_cliente);
            return View(oferta);
        }
Example #2
0
 public ActionResult Edit(Oferta oferta)
 {
     if (ModelState.IsValid)
     {
         db.Entry(oferta).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.id_cliente = new SelectList(db.Clientes, "id_cliente", "pais", oferta.id_cliente);
     return View(oferta);
 }