private void txtbLugar_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { TelefonoDatos tec = new TelefonoDatos(txtbtel.Text, txtbLugar.Text); dgvTelefonia.Rows.Add(tec.telefono, tec.lugar); } }
private void txtLugar_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { //Hola hola hola TelefonoDatos telefonoDatos = new TelefonoDatos(txtTelefono.Text, txtLugar.Text); dgvTelefonia.Rows.Add(telefonoDatos.telefono, telefonoDatos.lugar); } }
public void Guardar(Telefono tel) { if (tel.NumeroTelefono == 0) { throw new ApplicationException("Debe digitar un numero de telefono"); } TelefonoDatos datos = new TelefonoDatos(); if (datos.SeleccionarPorNumero(Int32.Parse(tel.NumeroTelefono.ToString())) == null) { datos.Insertar(tel); } else { datos.Actualizar(tel); } }
private void txtbLugar_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { if (txtbTelefono.Text != "" && txtbLugar.Text != "" && !llamada_en_curso) { TelefonoDatos telefonoDatos = new TelefonoDatos(txtbTelefono.Text, txtbLugar.Text); //Se inserta un elemento al DataGridView dgvTelefonia.Rows.Add(telefonoDatos.telefono, telefonoDatos.lugar, ts); tiempollamadaEvento.Start(); txtbLugar.Clear(); txtbTelefono.Clear(); llamada_en_curso = true; } else { MessageBox.Show("No se han ingresado datos"); } } }
public List <Telefono> SeleccionarTodos() { TelefonoDatos datos = new TelefonoDatos(); return(datos.SeleccionarTodos()); }