public static IEnumerable<Book> CreateBooks(int number, BookStatus status, Genre genre = null) { for (int i = 0; i < number; i++) { var book = new Book("blah", new[] {"jim", "John", "Jackie"}, "crap", genre ??new Genre("gumbo"), status, new[] {(byte) 1}); yield return book; } }
public Book(string title, IEnumerable<string> authors, string description, Genre genre, BookStatus status, byte[] image) { Title = title; Authors = authors; Review = description; Genre = genre; Status = status; Image = image; }
public Book() { Debug.WriteLine("Generating new Book"); Thread.Sleep(50); title = BookNameGenerator.NextBookTitle(); status = BookStatus.Review; progress = 0.0F; author = PersonNameGenerator.NextPersonName(); reviewDifficulty = P.Randomizer.Next(15, 45); Debug.WriteLine("review difficulty for " + title + ": " + reviewDifficulty); publishingDifficulty = P.Randomizer.Next(45, 120) + reviewDifficulty; sellingDifficulty = P.Randomizer.Next(120, 300) + publishingDifficulty; framesTillStatusChange = reviewDifficulty*difficultyIndex; _ID = idCounter; idCounter++; activeBooks.Add(this); }
/// <summary> /// 手动初始化类 /// </summary> /// <param name="title"></param> /// <param name="mainURL"></param> /// <param name="outPutDir"></param> public virtual void Initialize(string title, string mainURL, string outPutDir) { Epub = new EpubModel(); Epub.Title = title; BroswersUsingIndex = 0; Host = ""; MainURL = mainURL; OutPutDir = outPutDir; if(OutPutDir == "") OutPutDir = @"C:\新建文件夹\"; Status = BookStatus.Inited; }
public async Task <IActionResult> Search(CancellationToken cancellationToken, Language lan, CourseType ctype, int field, BookStatus bstatus, Pagable pagable) { var model = await _bookService.GetAllBookAsync(cancellationToken, ctype, bstatus, lan, field, pagable.Search); return(Ok(model)); }
public void Add(int bookNum, string bookCode, BookState state, IEnumerable <string> failedChecks = null) { m_books[bookNum] = new BookStatus { BookCode = bookCode, State = state, FailedChecks = failedChecks?.ToList() }; }
public Book() { Status = BookStatus.WaitingApproval; }
private async Task <IEnumerable <VendorBookDTO> > GetOrdersByStatus(string role, long id, BookStatus status) { var booksDTO = await GetOrdersAsync(role, id); List <Book> _booksEntity = new List <Book>(); if (role == "vendor") { var vendor = await _unitOfWork.VendorRepository.GetByIdAsync(id); if (vendor != null && vendor.Calendar != null && !vendor.Calendar.SeveralTaskPerDay) { _booksEntity = _unitOfWork.BookRepository.Query.Where(x => x.Vendor.Id == id).ToList(); CheckBooks(_booksEntity, ref booksDTO); } } else if (role == "company") { var company = await _unitOfWork.CompanyRepository.GetByIdAsync(id); if (company != null && company.Calendar != null && !company.Calendar.SeveralTaskPerDay) { _booksEntity = _unitOfWork.BookRepository.Query.Where(x => x.Company.Id == id).ToList(); CheckBooks(_booksEntity, ref booksDTO); } } if (booksDTO == null) { return(Enumerable.Empty <VendorBookDTO>()); } return(booksDTO.Where(b => b.Status == status)); }
private void booktitletxt_TextChanged(object sender, EventArgs e) { booktitle = booktitletxt.Text; ob = sd.GetBookName(booktitle); authorNameLabel.Text = ob.AuthorName; }
public void BookEnd(BookStatus status, BookData book) { }
public void UpdateBook() { if (status != BookStatus.Retired) { framesPast++; progress = (framesPast*1.0F) / framesTillStatusChange; publishingProgress.Value = progress; } if (framesPast >= framesTillStatusChange) { switch (this.status) { case BookStatus.Review: { this.status = BookStatus.Approved; framesTillStatusChange = publishingDifficulty*difficultyIndex; framesPast = 0; Notifications.AddNotification(this.title + " has been approved and the publishing segment has started."); break; } case BookStatus.Approved: { this.status = BookStatus.Selling; framesTillStatusChange = sellingDifficulty * difficultyIndex; framesPast = 0; Notifications.AddNotification(this.title + " has been published! It is now on the market!"); break; } case BookStatus.Selling: { this.status = BookStatus.Retired; framesPast = 0; Notifications.AddNotification(this.title + " has finished selling. It is now off the market."); break; } } } }