Exemplo n.º 1
0
 internal void Update(UserBook userBook)
 {
     userBook.BookId       = book;
     userBook.UserId       = user;
     userBook.LearnLevels  = learnLevels;
     userBook.LearnDates   = learnDates;
     userBook.ExamDates    = examDates;
     userBook.PromoteDates = promoteDates;
 }
Exemplo n.º 2
0
 public UserBookDto(UserBook userBook, Book book)
 {
     this.id           = userBook.Id;
     this.user         = userBook.UserId;
     this.book         = userBook.BookId;
     this.learnLevels  = userBook.LearnLevels;
     this.learnDates   = userBook.LearnDates;
     this.examDates    = userBook.ExamDates;
     this.promoteDates = userBook.PromoteDates;
     this.BookDto      = new BookDto(book, id);
     this.translations = new Dictionary <string, List <int> >();
 }
Exemplo n.º 3
0
        //internal async Task CreateFirstBook(string userId, LanguageType language) {
        //    var targetBook = await CreateUserBookAsync(userId, language, "J.London, Martin Eden");
        //    try {
        //        await this.Database.ExecuteSqlCommandAsync("exec dbo.CopyBookWords @sourceBookId, @targetBookId",
        //            new SqlParameter("@sourceBookId", 1),
        //            new SqlParameter("@targetBookId", targetBook.Id));
        //    } catch (Exception e) {
        //        _logger.Error(e, "Error calling dbo.CopyBookWords procedure");
        //    }
        //}

        internal async Task <UserBook> CreateUserBookForBookAsync(int bookId, string userId)
        {
            var userBook = new UserBook()
            {
                UserId = userId,
                BookId = bookId
            };

            UserBooks.Add(userBook);
            await SaveChangesAsync();

            return(userBook);
        }
Exemplo n.º 4
0
 internal void Update(UserBook userBook)
 {
     userBook.BookId = book;
     userBook.UserId = user;
     userBook.LearnLevels = learnLevels;
     userBook.LearnDates = learnDates;
     userBook.ExamDates = examDates;
     userBook.PromoteDates = promoteDates;
 }
Exemplo n.º 5
0
 public UserBookDto(UserBook userBook, Book book)
 {
     this.id = userBook.Id;
     this.user = userBook.UserId;
     this.book = userBook.BookId;
     this.learnLevels = userBook.LearnLevels;
     this.learnDates = userBook.LearnDates;
     this.examDates = userBook.ExamDates;
     this.promoteDates = userBook.PromoteDates;
     this.BookDto = new BookDto(book, id);
     this.translations = new Dictionary<string, List<int>>();
 }
Exemplo n.º 6
0
 public UserBookDto(UserBook userBook)
     : this(userBook, userBook.Book)
 {
 }
Exemplo n.º 7
0
 public UserBookDto(UserBook userBook)
     : this(userBook, userBook.Book)
 {
 }