public void approveBook(AudioBook ab) { ab.Approved = true; ab.ApprovedBy = new MongoDBRef(this.GetType().ToString().ToLower(), this.Id); ab.Save(); this.BooksApproved.Insert(0, new MongoDBRef("audiobook", ab.Id)); this.GetCollection().Save(this); }
public void updateBook(string description, string bookPath, string imgPath, string Name, string Author, string Narator) { AudioBook ab = new AudioBook(Name, Author); ab.setBook(bookPath); if (imgPath != null) { ab.setCover(imgPath); } if (Narator != null) { ab.setNarator(Narator); } if (description != null) { ab.setDescription(description); } ab.UpdatedBy = new MongoDBRef(this.GetType().ToString().ToLower(), this.Id); ab.Save(); this.UpdatedBook.Add(new MongoDBRef("audiobook", ab.Id)); this.GetCollection().Save(this); }