Пример #1
0
        /* ************** Metodos Form Activos Por Aula ***************/



        public void buscarActivo(string id)
        {
            var activoBuscado = ActivoBLL.BuscarUnActivo(id);

            agregarActivos.cargarActivos(activoBuscado); // llamo al metodo que carga el fomrulario
            agregarActivos.Show();                       // muestr el form
            agregarActivos.ocultarBotonesAlModificar();  // oculto el btn modificar
        }
Пример #2
0
        private void btnAceptarActivos_Click(object sender, EventArgs e)
        {
            BorrarError();
            if (ValidarCampos())
            {
                // Validar los campos en blanco

                string NumAula = (control.getLabelNumeroAula().Text);


                int AulaInsertarActivo = Convert.ToInt32(NumAula);

                double Depreciacion;
                int    numFactura;
                string fecha;



                fecha = fechaCreacion.Value.ToString("yyyy-MM-dd");


                Activo activos = new Activo
                {
                    Identificacion = txtIdentificacionActivo.Text,
                    Descripcion    = txtDescripcion.Text,
                    Marca          = txtMarca.Text,
                    Ubicacion      = txtUbicacion.Text,
                    Proveedor      = txtProveedor.Text,
                    //FechaCreacion = fecha,
                    IdLeyAdquirida = Int32.Parse(cmbLeyAdquirida.SelectedValue.ToString()),
                    IdCategoria    = Int32.Parse(cmbCategoría.SelectedValue.ToString()),
                    IdAula         = AulaInsertarActivo,
                    IdEstado       = Int32.Parse(cmbEstado.SelectedValue.ToString()),
                    IdUsuario      = control.MiUsuario.IdUsuario,


                    Depreciacion = "0"
                };



                Activo a = ActivoBLL.BuscarUnActivo(txtIdentificacionActivo.Text);

                if (a.Codigo == 99)
                {
                    ActivoBLL.AgregarActivo(activos, control.MiUsuario);

                    MessageBox.Show("Activo agregado Correctamente");

                    limpiartxt();
                    this.Visible = false;

                    control.RefrescarTablaActivosPorAulas(activos.IdAula);
                }
                else
                {
                    MessageBox.Show("Activo ya existe");
                }
            }
            else
            {
                MessageBox.Show("Error al ingresar datos");
            }
        }
Пример #3
0
        public Activo buscarActivoReparar(string id)
        {
            var activoBuscado = ActivoBLL.BuscarUnActivo(id);

            return(activoBuscado);
        }