Exemple #1
0
 public ActionResult Guardar(Empresa Emp, HttpPostedFileBase image)
 {
     if (ModelState.IsValid)
     {
         var vExiste = T_Empresa.Obtener(Emp.Emp_Cia);
         if (vExiste == null)
         {
             if (image != null)
             {
                 byte[] data = new byte[image.ContentLength];
                 image.InputStream.Read(data, 0, image.ContentLength);
                 Emp.Emp_Imagen = data;
             }
             T_Empresa.Guardar(Emp);
             return(RedirectToAction("Index", "Empresa"));
         }
         else
         {
             ViewBag.Existe = "S";
             return(View("~/Views/Empresa/Nuevo.cshtml", Emp));
         }
     }
     else
     {
         return(View("~/Views/Empresa/Nuevo.cshtml", Emp));
     }
 }
Exemple #2
0
 public ActionResult Index()
 {
     return(View(empresalogic.Obtener(1)));
 }