Exemple #1
0
 private void btnModificar_Click(object sender, EventArgs e)
 {
     try
     {
         var cliente = new Cliente
         {
             Id_Cliente     = Convert.ToInt32(txtId_Cliente.Text),
             Identificacion = txtIdentificacion.Text,
             Nombre         = txtNombre.Text,
             Telefono       = txtTelefono.Text,
             Correo         = txtCorreo.Text,
             Direccion      = txtDireccion.Text
         };
         cli.ActualizarCliente(cliente);
         MessageBox.Show("Cliente modificado correctamente", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtIdentificacion.Enabled = false;
         Limpiar();
         ActualizarGridView();
     }
     catch (Exception ex)
     {
         MessageBox.Show(string.Format("Ocurrio el siguiente error: {0}",
                                       ex.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        public ActionResult Edit(Models.Cliente cliente)
        {
            var clienteModificar = Mapper.Map <DATOS.Cliente>(cliente);

            if (ModelState.IsValid)
            {
                clien.ActualizarCliente(clienteModificar);
                return(RedirectToAction("Login"));
            }
            return(View(cliente));
        }
 protected void BtnAct_Click(object sender, EventArgs e)
 {
     try
     {
         Cliente cliente = new Cliente
         {
             Cedula        = Convert.ToInt32(TxtCedula.Text),
             NombreCliente = TxtNCliente.Text,
             Telefono      = Convert.ToInt32(TxtTelefono.Text),
             Movil         = Convert.ToInt32(TxtMovil.Text),
             Correo        = TxtCorreo.Text,
             Placa         = TxtPlaca.Text
         };
         cli.ActualizarCliente(cliente);
         MostarMensaje("Se actualizaron los datos");
         Limpiar();
     }
     catch (Exception)
     {
         MostarMensajeError("Ocurrio un error");
         Limpiar();
     }
     try
     {
         Auto auto = new Auto
         {
             Placa               = TxtPlaca.Text,
             Marca               = TxtMarca.Text,
             Estilo              = TxtMarca.Text,
             Ano                 = Convert.ToInt32(TxtAno.Text),
             Nota                = TxtNota.Text,
             Bin                 = Convert.ToInt32(TxtBin.Text),
             KM                  = Convert.ToInt32(TxtKM.Text),
             ProblemasVehiculo   = TxtProVeh.Text,
             RevisionIntervalos  = TxtRevInt.Text,
             MantenimientoPrevio = TxtManPrev.Text,
             DanosVehiculo       = TxtDanVeh.Text
         };
         aut.ActualizarAuto(auto);
         MostarMensaje("Se actualizaron los datos");
         Limpiar();
     }
     catch (Exception)
     {
         MostarMensajeError("Ocurrio un error");
         Limpiar();
     }
 }
Exemple #4
0
 public ActionResult ActualizarCliente(ClienteModel model)
 {
     _repo.ActualizarCliente(PrepareCliente(model));
     return(Ok());
 }