Exemplo n.º 1
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            var          form = new frmContacto(0, this);
            DialogResult vr   = form.ShowDialog(this);

            if (vr == System.Windows.Forms.DialogResult.OK)
            {
                this.actualizarContactos();
            }
            handlePaginacion();
        }
Exemplo n.º 2
0
        private void btnModificar_Click(object sender, EventArgs e)
        {
            Int32 selectedRowCount = dataContactos.Rows.GetRowCount(DataGridViewElementStates.Selected);

            if (selectedRowCount != 1)
            {
                var form2 = new frmAlert(this, "Seleccionar contacto", "Debe seleccionar un contacto para modificar", "close");
                form2.Show();
                return;
            }
            int          id   = Convert.ToInt32(this.dataContactos.SelectedRows[0].Cells[3].Value);
            var          form = new frmContacto(id, this);
            DialogResult vr   = form.ShowDialog(this);

            if (vr == System.Windows.Forms.DialogResult.OK)
            {
                this.handlePaginacion();
            }
        }