Exemple #1
0
 public ActionResult Edit([Bind(Include = "Id,Descripcion")] Sector sector)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sector).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sector));
 }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "Id,NombreEmpresa,Direccion_1,Direccion_2,SectorId,Pais,Telefono,Telefono2")] Empresa empresa)
 {
     if (ModelState.IsValid)
     {
         db.Entry(empresa).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SectorId = new SelectList(db.Sector, "Id", "Descripcion", empresa.SectorId);
     return(View(empresa));
 }