private void btnInsertar_Click(object sender, EventArgs e) { operation oper = new operation(); string id, nombre, apellidos, fecnac; id = txtId.Text; nombre = txtNombre.Text; apellidos = txtApellidos.Text; fecnac = dateTimePicker1.Value.Year.ToString() + "-" + dateTimePicker1.Value.Month.ToString() + "-" + dateTimePicker1.Value.Day.ToString(); oper.ExecuteNonQuery(" INSERT INTO cliente(nombre,apellidos,fecha)VALUES('" + nombre + "','" + apellidos + "','" + fecnac + "');"); this.Close(); }
private void btnActualizar_Click(object sender, EventArgs e) { operation oper = new operation(); string id, nombre, apellidos, fecnac; id = txtId.Text; nombre = txtNombre.Text; apellidos = txtApellidos.Text; fecnac = dateTimePicker1.Value.Year.ToString() + "-" + dateTimePicker1.Value.Month.ToString() + "-" + dateTimePicker1.Value.Day.ToString(); oper.ExecuteNonQuery(" UPDATE cliente SET nombre='" + nombre + "' ,apellidos='" + apellidos + "',fecnac='" + fecnac + "' WHERE id='" + id + "'"); this.Close(); }