Example #1
0
        private void btnNuevo_Click(object sender, EventArgs e)
        {
            FormCiudad frm = new FormCiudad();

            frm.nuevo = true;
            frm.ShowDialog();
            this.Lista();
        }
Example #2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            try
            {
                FormCiudad frm = new FormCiudad();
                var        t   = this.addCiudad.getDatos(int.Parse(this.dtLista.CurrentRow.Cells[0].Value.ToString()));

                frm.editar = true;

                frm.txtCodigo.Text = "0000" + t.ciu_codigo.ToString();
                frm.txtNombre.Text = t.ciu_nombre;
                frm.btnNuevo.Text  = "Editar";
                frm.ShowDialog();
                this.Lista();
            }
            catch (Exception)
            {
                MessageBox.Show("No se puede Editar\n", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }