コード例 #1
0
 public ActionResult Edit(PersonasModel collection)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var ddlOwner = new PersonasBLL();
             var persona  = new Personas()
             {
                 PersonasId      = collection.PersonasId,
                 Apellido        = collection.Apellido,
                 Celular         = collection.Celular,
                 DU              = collection.DU,
                 Email           = collection.Email,
                 Telefono        = collection.Telefono,
                 Nombre          = collection.Nombre,
                 TelefonoLaboral = collection.TelefonoLaboral
             };
             ddlOwner.Update(persona);
             ViewBag.TipoMsj = "Success";
             ViewBag.Message = "El cliente se registro con Exito!!!";
             return(View());
         }
         else
         {
             ViewBag.TipoMsj = "Info";
             ViewBag.Message = string.Join("; ", ModelState.Values
                                           .SelectMany(x => x.Errors)
                                           .Select(x => x.ErrorMessage));
             return(View(collection));
         }
     }
     catch (Exception ex)
     {
         ViewBag.TipoMsj = "Error";
         ViewBag.Message = ex.Message;
         return(View(collection));
     }
 }