private void btnGuardar_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtValor.Text)) { errorVehiculo.SetError(txtValor, "Ingrese el Valor del Estado en Vehiculo"); return; } else { errorVehiculo.SetError(txtValor, ""); } VehiculoD obj = new VehiculoD(); VehiculoD.VehiculoE entidad = new VehiculoD.VehiculoE(); entidad.VehiculoID = IDVehiculo; entidad.Valor = Convert.ToDecimal(txtValor.Text); int resultado = obj.Modificar(entidad); if (resultado == 1) { ControlVehiculos vehiculo = new ControlVehiculos(); vehiculo.Show(); this.Close(); } }
private void Obtener() { DataSet ds; VehiculoD obj = new VehiculoD(); ds = obj.Seleccionar(); GridView.DataSource = ds.Tables[0]; }