コード例 #1
0
ファイル: FormCliente.cs プロジェクト: notavgkaren/RentCar
 private void btnAgregar_Click(object sender, EventArgs e)
 {
     using (FormClienteAddEdit form = new FormClienteAddEdit(null))
     {
         if (form.ShowDialog() == DialogResult.OK)
         {
             clienteBindingSource.DataSource = db.Clientes.ToList();
         }
     }
 }
コード例 #2
0
ファイル: FormCliente.cs プロジェクト: notavgkaren/RentCar
        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();
                }
            }
        }