Ejemplo n.º 1
0
 public ActionResult Create2([Bind(Include = "Id_Comuna,Id_Estamento,Desc_Empresa")] Mae_Empresa empresa)
 {
     try
     {
         empresa.Save();
         TempData["mensaje"] = "Guardado correctamente";
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View("Create"));
     }
 }
Ejemplo n.º 2
0
 public ActionResult Edit(Mae_Empresa empresa)
 {
     try
     {
         empresa.Update();
         TempData["mensaje"] = "Modificado correctamente";
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View("Index"));
     }
 }
Ejemplo n.º 3
0
        public ActionResult Edit(int id)
        {
            Mae_Empresa u = new Mae_Empresa().Find(id);

            if (u == null)
            {
                TempData["Mensaje"] = "El usuario no existe";
                return(RedirectToAction("Index"));
            }
            EnviarComuna();
            EnviarEstamento();
            ViewBag.empresas = new Models.Clases.Mae_Empresa().ReadAllSinFiltro();

            return(View(u));
        }