Exemple #1
0
 public ActionResult EditarEmpresa(EmpresaModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.ImagesProperty.Length > 0 && model.ImagesProperty[0].ContentLength > 0)
         {
             model.LogoUrl = string.Format("~/Content/LogosEmpresa/{0}", model.ImagesProperty[0].FileName);
             model.ImagesProperty[0].SaveAs(Server.MapPath(model.LogoUrl));
         }
         model = Metodos.ActualizarEmpresa(model);
         if (!string.IsNullOrEmpty(model.ErrorUpdating))
         {
             ModelState.AddModelError("", model.ErrorUpdating);
         }
         else
         {
             Auditoria.RegistarAccion(eTipoAccion.Actualizar);
         }
     }
     return(View(model));
 }