Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                if (validarCampos())
                {
                    ClsCliente c = new ClsCliente();
                    c.ID       = Convert.ToInt32(txtID.Text);
                    c.Nombre   = txtNombre.Text;
                    c.Apellido = txtApellido.Text;
                    c.DNI      = Convert.ToInt32(txtDNI.Text);
                    c.FechaNac = Convert.ToDateTime(dtFechaNac.Text);
                    c.Email    = txtEmail.Text;

                    cBll.Actualizar(c);

                    ObtenerClientes();
                }
                else
                {
                    MessageBox.Show("Datos mal ingresados");
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ha ocurrido un error");
                return;
            }
        }
Exemple #2
0
 public ActionResult Edit(ClienteVM cliente)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _clienteService.Actualizar(cliente);
             return(RedirectToAction("Index"));
         }
         //ViewBag.TipoDocumentoId = new SelectList(_tipoDocumentoService.ObtenerTipoDocumentos(), "ID", "Descripcion",cliente.TipoDocumentoId);
         return(View(cliente));
     }
     catch (Exception ex)
     {
         return(View("Error"));
     }
 }