Exemplo n.º 1
0
 public List <CITITOR> GetReaderByName(string nameCititor)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.CITITORs.Where(t => (t.Nume + " " + t.Prenume) == nameCititor).ToList());
     }
 }
Exemplo n.º 2
0
 public List <CITITOR> GetReaderById(int cititorId)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.CITITORs.Where(t => t.CititorId == cititorId).ToList());
     }
 }
Exemplo n.º 3
0
 public List <GEN> GetGenreById(int genId)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.GENs.Where(t => t.GenId == genId).ToList());
     }
 }
Exemplo n.º 4
0
 public List <CITITOR> VerifyReaderByName(string numeCititor)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.CITITORs.Where(x => (x.Nume.Trim() + " " + x.Prenume.Trim()) == numeCititor.Trim()).ToList());
     }
 }
Exemplo n.º 5
0
 public List <IMPRUMUT> GetLoanByBookId(int carteId)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.IMPRUMUTs.Where(t => t.CarteId == carteId).ToList());
     }
 }
Exemplo n.º 6
0
 public List <IMPRUMUT> GetLoanById(int imprumutId)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.IMPRUMUTs.Where(t => t.ImprumutId == imprumutId).ToList());
     }
 }
Exemplo n.º 7
0
 public List <GEN> GetGenreByName(string numeGen)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.GENs.Where(x => x.Descriere == numeGen).ToList());
     }
 }
Exemplo n.º 8
0
 public List <REVIEW> GetAllReviews()
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.REVIEWs.ToList());
     }
 }
Exemplo n.º 9
0
 public List <AUTOR> GetAuthorByName(string numeAutor)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.AUTORs.Where(x => (x.Nume.Trim() + " " + x.Prenume.Trim()) == numeAutor.Trim()).ToList());
     }
 }
Exemplo n.º 10
0
 public List <AUTOR> GetAuthorById(int autorId)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.AUTORs.Where(t => t.AutorId == autorId).ToList());
     }
 }
Exemplo n.º 11
0
 public List <IMPRUMUT> GetAllLoans()
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.IMPRUMUTs.ToList());
     }
 }
Exemplo n.º 12
0
 public List <CARTE> GetBookByTitle(string titluCarte)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.CARTEs.Where(x => x.Titlu.Trim() == titluCarte.Trim()).Distinct().ToList());
     }
 }
Exemplo n.º 13
0
 public List <CARTE> GetAllBooksByGen(string genCarte)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.CARTEs.Where(t => t.GEN.Descriere.Trim() == genCarte.Trim()).Distinct().ToList());
     }
 }
Exemplo n.º 14
0
 public List <CARTE> GetAllBooksByAuthor(string numeAutor)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.CARTEs.Where(t => (t.AUTOR.Nume.Trim() + " " + t.AUTOR.Prenume.Trim()) == numeAutor.Trim()).Distinct().ToList());
     }
 }
Exemplo n.º 15
0
 public List <CARTE> GetAllBooks()
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.CARTEs.ToList());
     }
 }
Exemplo n.º 16
0
 public List <CARTE> GetBookById(int carteId)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.CARTEs.Where(t => t.CarteId == carteId).ToList());
     }
 }
Exemplo n.º 17
0
 public int GetNumberOfExistingBooksByTitle(string titluCarte)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.CARTEs.Where(x => x.Titlu.Trim() == titluCarte.Trim()).Count());
     }
 }
Exemplo n.º 18
0
 public List <CARTE> GetBooksByAuthorTitle(string numeAutor, string titluCarte)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.CARTEs.Where(x => (x.AUTOR.Nume.Trim() + " " + x.AUTOR.Prenume.Trim()) == numeAutor.Trim() && x.Titlu.Trim() == titluCarte.Trim()).Distinct().ToList());
     }
 }
Exemplo n.º 19
0
 public List <AUTOR> GetAllAuthors()
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.AUTORs.ToList());
     }
 }
Exemplo n.º 20
0
 public List <REVIEW> GetReviewById(int reviewId)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.REVIEWs.Where(t => t.ReviewId == reviewId).ToList());
     }
 }
Exemplo n.º 21
0
 public List <CITITOR> GetAllReaders()
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.CITITORs.ToList());
     }
 }
Exemplo n.º 22
0
 public List <GEN> GetAllGenres()
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.GENs.ToList());
     }
 }
Exemplo n.º 23
0
 public List <GEN> VerifyGenreByDescription(string numeGen)
 {
     using (var context = new ModelDatabaseFirst())
     {
         return(context.GENs.Where(x => x.Descriere.Trim() == numeGen.Trim()).ToList());
     }
 }
Exemplo n.º 24
0
 public int GetNumberOfBorrowedBooksByTitle(string titluCarte)
 {
     using (var context = new ModelDatabaseFirst())
     {
         DateTime restituire = new DateTime(1900, 1, 1);
         return(context.IMPRUMUTs.Where(x => x.CarteId == x.CARTE.CarteId && x.CARTE.Titlu.Trim() == titluCarte.Trim() && x.DataRestituire == restituire).Count());
     }
 }
Exemplo n.º 25
0
 public CARTE UpdateBook(CARTE carte)
 {
     using (var context = new ModelDatabaseFirst())
     {
         context.CARTEs.AddOrUpdate(carte);
         context.SaveChanges();
         return(carte);
     }
 }
Exemplo n.º 26
0
 public AUTOR UpdateAuthor(AUTOR autor)
 {
     using (var context = new ModelDatabaseFirst())
     {
         context.AUTORs.AddOrUpdate(autor);
         context.SaveChanges();
         return(autor);
     }
 }
Exemplo n.º 27
0
 public GEN UpdateGenre(GEN gen)
 {
     using (var context = new ModelDatabaseFirst())
     {
         context.GENs.AddOrUpdate(gen);
         context.SaveChanges();
         return(gen);
     }
 }
Exemplo n.º 28
0
 public IMPRUMUT UpdateLoan(IMPRUMUT imprumut)
 {
     using (var context = new ModelDatabaseFirst())
     {
         context.IMPRUMUTs.AddOrUpdate(imprumut);
         context.SaveChanges();
         return(imprumut);
     }
 }
Exemplo n.º 29
0
 public REVIEW UpdateReview(REVIEW review)
 {
     using (var context = new ModelDatabaseFirst())
     {
         context.REVIEWs.AddOrUpdate(review);
         context.SaveChanges();
         return(review);
     }
 }
Exemplo n.º 30
0
 public CITITOR UpdateReader(CITITOR cititor)
 {
     using (var context = new ModelDatabaseFirst())
     {
         context.CITITORs.AddOrUpdate(cititor);
         context.SaveChanges();
         return(cititor);
     }
 }