public string Create(Category category)
        {
            var result = repasitory.Insert(category);

            repasitory.Save();
            return(category.Id + result);
        }
        public string Create(Book book)
        {
            var result = repasitory.Insert(book);

            repasitory.Save();
            return(book.Id + result);
        }
        public string Create(Author author)
        {
            var result = repasitory.Insert(author);

            repasitory.Save();
            return(author.Id + result);
        }
Beispiel #4
0
        public string Create(Publications Publications)
        {
            var result = repasitory.Insert(Publications);

            repasitory.Save();
            return(Publications.Id + result);
        }
        public string Register(BookCategory bookcat)
        {
            var testbook     = b_repository.GetAll().Where(ab => ab.Id == bookcat.IdBook).ToList().Count;
            var testcategory = c_repository.GetAll().Where(ab => ab.Id == bookcat.IdCategory).ToList().Count;

            if (testcategory == 0)
            {
                return("Not Found any author whit this id");
            }
            if (testbook == 0)
            {
                return("Not Found any book whit this id");
            }

            repasitory.Insert(bookcat);
            repasitory.Save();
            return(bookcat.Id + " register...");
        }
Beispiel #6
0
        public string Register(BookAuthor bookAuthor)
        {
            var testbook   = b_repository.GetAll().Where(ab => ab.Id == bookAuthor.IdBook).ToList().Count;
            var testauthor = a_repository.GetAll().Where(ab => ab.Id == bookAuthor.IdAuthor).ToList().Count;

            if (testauthor == 0)
            {
                return("Not Found any author with this id");
            }
            if (testbook == 0)
            {
                return("Not Found any book with this id");
            }

            repasitory.Insert(bookAuthor);
            repasitory.Save();
            return(bookAuthor.Id + " register...");
        }