Example #1
0
        public override void btAlterar_Click(object sender, EventArgs e)
        {
            base.btAlterar_Click(sender, e);

            Enabled(false);
            if (Grid.CurrentRow != null)
            {
                var obj = (Database_Class.Classes.Cliente)Grid.CurrentRow.DataBoundItem;

                var frm = new FormCadastroCliente(obj);
                frm.ShowDialog();
                frm.Dispose();

                AtualizarGrid();
            }

            Enabled(true);
        }
Example #2
0
        public override void btInserir_Click(object sender, EventArgs e)
        {
            base.btInserir_Click(sender, e);

            Enabled(false);

            var frm = new FormCadastroCliente(null);

            frm.ShowDialog();

            if (frm.gravou)
            {
                bindingSource.Add(frm.cliente);
            }

            frm.Dispose();

            AtualizarGrid();

            Enabled(true);
        }