private void datagdVoluntarios_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            _Voluntarios   selec      = datagdVoluntarios.SelectedItem as _Voluntarios;
            _VoluntariosLN voluntario = new _VoluntariosLN();

            idVol = selec.idVoluntarios;

            WinAddVoluntario nWinAddVoluntario = new WinAddVoluntario();

            System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(nWinAddVoluntario);

            nWinAddVoluntario.txtNombres.Text          = selec.nombres;
            nWinAddVoluntario.txtApellidos.Text        = selec.apellidos;
            nWinAddVoluntario.txtDireccion.Text        = selec.direccion;
            nWinAddVoluntario.txtTelefono.Text         = selec.telefono;
            nWinAddVoluntario.txtCorreo.Text           = selec.correo;
            nWinAddVoluntario.txtNombreEmergencia.Text = selec.personaEmergencia;
            nWinAddVoluntario.txtTelEmergencia.Text    = selec.telefonoEmergencia;
            nWinAddVoluntario.txtUniversidad.Text      = selec.universidad;
            nWinAddVoluntario.cmbDepartamento.Text     = selec.nombreD;
            nWinAddVoluntario.cmbMunicipio.Text        = selec.nombreM;
            nWinAddVoluntario.btnGuardar.Visibility    = Visibility.Hidden;
            nWinAddVoluntario.getId(idVol);
            nWinAddVoluntario.ShowDialog();
            fillDataGrid();
        }
        private void btnDelet_Click(object sender, RoutedEventArgs e)
        {
            _Voluntarios   selec      = datagdVoluntarios.SelectedItem as _Voluntarios;
            _VoluntariosLN voluntario = new _VoluntariosLN();
            Boolean        correcto   = voluntario.Ingresar_V();

            idVol = selec.idVoluntarios;

            if (correcto)
            {
                if (MessageBox.Show("¿Desea eliminar a este voluntario?", "Confirmación", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                {
                    voluntario.Eliminar_V(idVol);
                    fillDataGrid();
                }
                else
                {
                    fillDataGrid();
                }
            }
            else
            {
                MessageBox.Show(voluntario._obtenerError());
            }
        }
        public UC_Voluntarios()
        {
            this.InitializeComponent();
            _VoluntariosLN vol = new _VoluntariosLN();

            fillDataGrid();
        }
        private void btnModificar_Click(object sender, RoutedEventArgs e)
        {
            bool bandera = verificar();

            if (!bandera)
            {
                String nombres   = txtNombres.Text;
                String apellidos = txtApellidos.Text;
                String direccion = txtDireccion.Text;
                String telefono  = txtTelefono.Text;
                String correo    = txtCorreo.Text;
                int    dpto      = Convert.ToInt32(cmbDepartamento.SelectedValue);
                int    mun       = Convert.ToInt32(cmbMunicipio.SelectedValue);
                String persEm    = txtNombreEmergencia.Text;
                String telEm     = txtTelEmergencia.Text;
                String Univ      = txtUniversidad.Text;

                _VoluntariosLN voluntario = new _VoluntariosLN(nombres, apellidos, telefono, direccion, correo, true, dpto, mun, persEm, telEm, Univ);
                Boolean        correcto   = voluntario.Ingresar_V();


                if (correcto)
                {
                    voluntario.Modificar_V(currentid);
                    this.Close();
                }
                else
                {
                    MessageBox.Show(voluntario._obtenerError());
                }
            }
        }
        private void btnPlus_Click(object sender, RoutedEventArgs e)
        {
            WinAddVoluntario nWinAddVoluntario = new WinAddVoluntario();
            _VoluntariosLN   voluntario        = new _VoluntariosLN();

            System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(nWinAddVoluntario);
            nWinAddVoluntario.btnModificar.Visibility = Visibility.Hidden;
            nWinAddVoluntario.ShowDialog();
            fillDataGrid();
        }
Beispiel #6
0
        public UC_Manage()
        {
            this.InitializeComponent();
            dpFecha.SelectedDate = DateTime.Now.Date;
            _VoluntariosLN  Personas = new _VoluntariosLN();
            _HerramientasLN Tools    = new _HerramientasLN();

            fillCboxNombre(Personas);
            fillCboxHerramientas(Tools);
            cbxVoluntario.Focus();
            cbxVoluntario.IsDropDownOpen = true;
            cbxVoluntario.Focus();
        }
        private void btnEliminar_Click(object sender, RoutedEventArgs e)
        {
            _VoluntariosLN voluntario = new _VoluntariosLN();
            Boolean        correcto   = voluntario.Ingresar_V();


            if (correcto)
            {
                if (MessageBox.Show("¿Desea eliminar a este voluntario?", "Confirmación", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                {
                    voluntario.Eliminar_V(currentid);
                    this.Close();
                    newUcVol.fillDataGrid();
                }
                else
                {
                    newUcVol.fillDataGrid();
                }
            }
            else
            {
                MessageBox.Show(voluntario._obtenerError());
            }
        }
        public void fillDataGrid()
        {
            _VoluntariosLN voluntarios = new _VoluntariosLN();

            datagdVoluntarios.ItemsSource = voluntarios.Obtener_V();
        }
Beispiel #9
0
 private void fillCboxNombre(_VoluntariosLN Voluntarios)
 {
     cbxVoluntario.ItemsSource       = Voluntarios.Obtener_V();
     cbxVoluntario.SelectedValuePath = "idVoluntarios";
     cbxVoluntario.DisplayMemberPath = "nombres";
 }