Exemplo n.º 1
0
 private void btnAgregar_Click(object sender, EventArgs e)
 {
     using (FormClienteAddEdit form = new FormClienteAddEdit(null))
     {
         if (form.ShowDialog() == DialogResult.OK)
         {
             clienteBindingSource.DataSource = db.Clientes.ToList();
         }
     }
 }
Exemplo n.º 2
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            var obj = clienteBindingSource.Current;

            if (obj == null)
            {
                return;
            }

            using (FormClienteAddEdit form = new FormClienteAddEdit(obj as Cliente))
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    clienteBindingSource.DataSource = db.Clientes.ToList();
                }
            }
        }