Exemplo n.º 1
0
 public bool Existe(int Id)
 {
     try
     {
         Biblioteca.DALC.DOCUMENTO doc = CommonBC.ModeloBiblioteca.DOCUMENTO.First
                                             (d => d.IDDOCUMENTO == Id);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 2
0
 public string InfoDocumento(int Id)
 {
     try
     {
         Biblioteca.DALC.DOCUMENTO doc = CommonBC.ModeloBiblioteca.DOCUMENTO.First
                                             (d => d.IDDOCUMENTO == Id);
         return(doc.TITULODOCUMENTO + ", " + doc.AUTORDOCUMENTO);
     }
     catch (Exception)
     {
         return(String.Empty);
     }
 }
Exemplo n.º 3
0
        public bool Delete(int Id)
        {
            try
            {
                Biblioteca.DALC.DOCUMENTO doc = CommonBC.ModeloBiblioteca.DOCUMENTO.First
                                                    (d => d.IDDOCUMENTO == Id);

                CommonBC.ModeloBiblioteca.DeleteObject(doc);
                CommonBC.ModeloBiblioteca.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        public bool Update(int id, string titulo, string autor, string anio, string tipo, string editorial, string edicion, string categoria)
        {
            try
            {
                Biblioteca.DALC.DOCUMENTO doc = CommonBC.ModeloBiblioteca.DOCUMENTO.First
                                                    (d => d.IDDOCUMENTO == id);
                doc.TITULODOCUMENTO    = titulo;
                doc.AUTORDOCUMENTO     = autor;
                doc.ANIODOCUMENTO      = anio;
                doc.TIPODOCUMENTO      = tipo;
                doc.EDITORIALDOCUMENTO = editorial;
                doc.EDICIONDOCUMENTO   = edicion;
                doc.CATEGORIADOCUMENTO = categoria;
                CommonBC.ModeloBiblioteca.SaveChanges();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }