コード例 #1
0
        public Boolean Ingresar_V()
        {
            Boolean      _correcto   = true;
            _Voluntarios _voluntario = new _Voluntarios(0, nombres, apellidos, telefono, direccion, correo, activo, municipio, departamento, personaEmergencia, telefonoEmergencia, universidad);

            this.idVoluntarios      = _voluntario.idVoluntarios;
            this.nombres            = _voluntario.nombres;
            this.apellidos          = _voluntario.apellidos;
            this.telefono           = _voluntario.telefono;
            this.direccion          = _voluntario.direccion;
            this.correo             = _voluntario.correo;
            this.activo             = _voluntario.activo;
            this.personaEmergencia  = _voluntario.personaEmergencia;
            this.telefonoEmergencia = _voluntario.telefonoEmergencia;
            this.municipio          = _voluntario.municipio;
            this.departamento       = _voluntario.departamento;

            this.errores = _voluntario.errores;

            if (errores.Count > 0)
            {
                _correcto = false;
            }
            return(_correcto);
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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());
            }
        }
コード例 #4
0
        private void btnAceptar_Click(object sender, RoutedEventArgs e)
        {
            _Voluntarios elegido = cbxVoluntario.SelectedItem as _Voluntarios;

            this.setChosen(elegido);
            this.setIsVolunteerSelected(true);
            this.Close();
        }
コード例 #5
0
        private void btnFiltrar_Click(object sender, RoutedEventArgs e)
        {
            WinFiltro nWinFiltro = new WinFiltro();

            nWinFiltro.ShowDialog();
            if (nWinFiltro.isVolunteerSelected())
            {
                voluntario        = nWinFiltro.getChosen();
                lblFiltro.Content = "Filtrado por " + voluntario.nombres;
                filtrarPrestamo();
            }
        }
コード例 #6
0
 private void specialFill(_Voluntarios v)
 {
     if (v != null)
     {
         lblFiltro.Content = "Filtrado por " + v.nombres;
         DataGridListadoPrestamos.ItemsSource = null;
         DataGridListadoPrestamos.ItemsSource = new _PrestamosLN().buscarPrestamosPor(v.idVoluntarios);
     }
     else
     {
         fillGrid();
     }
 }
コード例 #7
0
        private void fillComboBox()
        {
            _Insumos insumos = new _Insumos();

            cbxInsumos.ItemsSource       = insumos._Obtener_In();
            cbxInsumos.SelectedValuePath = "idAlimentos";
            cbxInsumos.DisplayMemberPath = "Nombre";

            _Voluntarios voluntario = new _Voluntarios();

            cbxVoluntarios.ItemsSource       = voluntario.Obtener_V();
            cbxVoluntarios.SelectedValuePath = "idVoluntario";
            cbxVoluntarios.DisplayMemberPath = "nombres";
        }
コード例 #8
0
        /*
         * Método para guardar el detalle como la salida del alimento y actualizar su existencia
         */
        private void Guardar()
        {
            int idSalida = 0;
            _DetalleSalidaLN detalleSalida = new _DetalleSalidaLN();
            _InsumosLN       contenido     = new _InsumosLN();
            List <_Insumos>  listInsumos   = new List <_Insumos>();

            listInsumos = contenido.obtenerListado(detalle);
            try
            {
                _Voluntarios voluntario  = cbxVoluntarios.SelectedItem as _Voluntarios;
                _SalidaLN    datosSalida = new _SalidaLN(DateTime.Now.Date, currentUser.idUsuarios, 0, txtDescripcion.Text, voluntario.idVoluntarios);
                Boolean      correcto    = datosSalida.ingresarSalida();
                if (correcto)
                {
                    idSalida = datosSalida._InsertarSalida();
                    detalleSalida.insertarDetalle(listInsumos, idSalida);
                    MessageBox.Show("Salida de insumos exitosa, generando reporte", "Éxito", MessageBoxButton.OK, MessageBoxImage.Information);
                    //if (MessageBox.Show("Salida exitosa, ¿Desea imprimir reporte?", "Éxito", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes)
                    //{
                    //Generar reporte
                    frmReportesSalidas MostrarRpt = new frmReportesSalidas();
                    MostrarRpt.idSalida = idSalida;
                    MostrarRpt.ShowDialog();
                    //}
                    clearContent();
                    fillComboBox();
                    correcto = false;
                    detalle  = new ObservableCollection <_InsumosLN>();
                }
                else
                {
                    MessageBox.Show(datosSalida.obtenerError());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Debe completar la información para poder guardar", "Cuidado", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
コード例 #9
0
        private void saveContent()
        {
            int idPrestamo = 0;
            _DetallePrestamoLN   detallesPrestamo = new _DetallePrestamoLN();
            _HerramientasLN      contenido        = new _HerramientasLN();
            List <_Herramientas> listTools        = new List <_Herramientas>();

            listTools = contenido.obtenerListado(detalle);

            try
            {
                _Voluntarios voluntario    = cbxVoluntario.SelectedItem as _Voluntarios;
                _PrestamosLN datosPrestamo = new _PrestamosLN(currentUser.idUsuarios, voluntario.idVoluntarios, Convert.ToDateTime(dpFecha.SelectedDate), txtObservaciones.Text);
                Boolean      correcto      = datosPrestamo.ingresarPrestamo();

                if (correcto)
                {
                    idPrestamo = datosPrestamo._InsertarPrestamo();
                    detallesPrestamo.insertarDetalle(listTools, idPrestamo);
                    MessageBox.Show("Préstamo asignado exitosamente, generando reporte", "Éxito", MessageBoxButton.OK, MessageBoxImage.Information);
                    //Reporte
                    frmPrestamoHerramientas MostrarRpt = new frmPrestamoHerramientas();
                    MostrarRpt.idPrestamo = idPrestamo;
                    MostrarRpt.ShowDialog();
                    clearContent();
                    fillCboxHerramientas(contenido);
                }
                else
                {
                    MessageBox.Show(datosPrestamo.obtenerError());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Debe completar la información para poder guardar", "Cuidado", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
コード例 #10
0
 private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     voluntario = cbxVoluntarios.SelectedItem as _Voluntarios;
     filtrarPrestamoV();
 }
コード例 #11
0
 public void setChosen(_Voluntarios v)
 {
     this.chosen = v;
 }
コード例 #12
0
 public UC_ShowPrestamo(_Voluntarios v)
 {
     this.InitializeComponent();
 }