private void btnEditar_Click(object sender, EventArgs e) { try { dtLista.Focus(); FormProveedor frm = new FormProveedor(); var t = this.addProveedor.getDatos(int.Parse(this.dtLista.CurrentRow.Cells[0].Value.ToString())); frm.editar = true; frm.txtCodigo.Text = "0000" + t.Codigo.ToString(); frm.txtNombre.Text = t.Nombre; frm.txtDireccion.Text = t.Direccion; frm.txtCiudad.Text = t.Ciudad; //MessageBox.Show(t.Ciudad); frm.txtTelefono.Text = t.Telefono; frm.txtCelular.Text = t.Celular; frm.txtEmail.Text = t.Email; frm.txtIdentificacion.Text = t.Identificacion; frm.btnNuevo.Text = "Editar"; frm.ShowDialog(); this.Lista(); } catch (Exception) { MessageBox.Show("No se puede Editar\n", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public FormProveedor() { InitializeComponent(); txtCiudad.AutoCompleteCustomSource = FormProveedor.LoadAutoCompleteCiudad(); txtCiudad.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txtCiudad.AutoCompleteSource = AutoCompleteSource.CustomSource; }
private void btnNuevo_Click(object sender, EventArgs e) { FormProveedor frm = new FormProveedor(); frm.nuevo = true; frm.ShowDialog(); this.Lista(); }