protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BooksLogic bl = new BooksLogic(); List <Book> notBorrowedBooks = bl.GetNotBorrowedBooks(); if (notBorrowedBooks.Count == 0) { CannotAddBorrowing.Visible = true; CanAddBorrowing.Visible = false; } else { CanAddBorrowing.Visible = true; CannotAddBorrowing.Visible = false; var db = new BookLibraryContext(); FillInMemberControl(db); FillInBookControl(db); FromDate.Text = DateTime.Now.ToString("MM/dd/yyyy"); } ViewState["ReferrerUrl"] = Request.UrlReferrer.ToString(); } }
public void TestInitialization() { _bookLogic = new BooksLogic(_mockMapper.Object, _mockBookRepo.Object); _bookVM = Builder <Book> .CreateNew().Build(); _bookDM = Builder <DataModel.Book> .CreateNew().Build(); }
protected override void OnClosed() { base.OnClosed(); UsersLogic.Dispose(); BooksLogic.Dispose(); OrdersLogic.Dispose(); }
private void OnOrderEditViewModelClosed(object sender, EventArgs e) { var orderEditViewModel = sender as OrderEditViewModel; if (orderEditViewModel != null && orderEditViewModel.ModalResult) { BooksLogic.Dispose(); BooksLogic = ServiceLocator.GetInstance <IBooksLogic>(); Search(); } }
protected void DeleteBookButton_Click(Object sender, EventArgs e) { Button btn = (Button)sender; string bookID = btn.CommandArgument.ToString(); BooksLogic bl = new BooksLogic(); bool savedChanges = bl.DeleteBook(Convert.ToInt32(bookID)); if (savedChanges) { Response.Redirect("AdminBooks"); } }
private void Search() { using (StartOperation()) { if (ISBN.IsNullOrEmpty() && SearchString.IsNullOrEmpty()) { Amounts = new BookAmount[] { }; return; } Amounts = BooksLogic.SearchBooks(Employee.BranchId, ISBN, SearchString); } }
protected void SaveBookButton_Click(object sender, EventArgs e) { BooksLogic bl = new BooksLogic(); bool saveSuccess = bl.AddBook(ISBN.Text, BookTitle.Text, Category.SelectedValue, Author.SelectedValue, Publisher.Text, PublicationYear.Text, Price.Text); if (saveSuccess) { ReturnToSender(); } else { FailureText.Text = "Unable to add a new book to database."; ErrorMessage.Visible = true; } }
protected void UpdateBookButton_Click(object sender, EventArgs e) { BooksLogic bl = new BooksLogic(); bool saveSuccess = bl.UpdateBook(Convert.ToInt32(Request["id"]), ISBN.Text, BookTitle.Text, Category.SelectedValue, Author.SelectedValue, Publisher.Text, PublicationYear.Text, Price.Text); if (saveSuccess) { ReturnToSender(); } else { FailureText.Text = "Unable to update the book."; ErrorMessage.Visible = true; } }
public IHttpActionResult UploadPic(int bookId) { string imageName = "picBook" + bookId + ".jpg"; var httpRequest = HttpContext.Current.Request; if (httpRequest.Files.Count > 0) { foreach (string file in httpRequest.Files) { var postedFile = httpRequest.Files[file]; var filePath = HttpContext.Current.Server.MapPath("~/Images/" + imageName); postedFile.SaveAs(filePath); } } BooksLogic.saveImageName(bookId, imageName); return(Ok(1)); }
protected void FillInBookControl(BookLibraryContext db) { if (Request.Params.AllKeys.Contains("bookID")) { int bookID = Convert.ToInt32(Request["bookID"]); Book book = db.Books.Single(b => b.BookID == bookID); BookTextBox.Text = book.ISBN + " " + book.Title; BookListLabel.Visible = false; BookList.Visible = false; BookTextBoxLabel.Visible = true; BookTextBox.Visible = true; } else { BookList.DataValueField = "BookID"; BookList.DataTextField = "DisplayName"; BooksLogic bl = new BooksLogic(); List <Book> notBorrowedBooks = bl.GetNotBorrowedBooks(); /* * foreach (Book b in notBorrowedBooks) * { * b.DisplayName = b.ISBN + " " + b.Title; * } */ BookList.DataSource = notBorrowedBooks; BookList.DataBind(); BookListLabel.Visible = true; BookList.Visible = true; BookTextBoxLabel.Visible = false; BookTextBox.Visible = false; } }
public void editBook(Books b) { BooksLogic.editBook(b); return; }
public List <BookToList> Serch(string name, int?categoryIdSearch, string autherToSerch, string publishingToSerch, int?cityCode) { return(BooksLogic.Serch(name, categoryIdSearch, autherToSerch, publishingToSerch, cityCode)); }
public List <Books> getAllUsersBooksByIDU(int idu) { return(BooksLogic.getAllUsersBooksByIDU(idu)); }
public void deleteBookFromMyBuskate(int idB, int idU) { BooksLogic.deleteBookFromMyBuskate(idB, idU); }
public void addBookToMybasket(MyBasketOfBooksModels obj) { BooksLogic.addBookToMybasket(obj); return; }
public List <Books> getAllMyBasket(int idU) { return(BooksLogic.getAllMyBasket(idU)); }
public void PromoteNumberOfViewers(int idBook) { BooksLogic.PromoteNumberOfViewers(idBook); return; }
public int InsertBook(Books newBook) { return(BooksLogic.InsertBook(newBook)); }
internal ConsoleUI() { this.bl = new BooksLogic(); }
public List <BookToList> GetAllBook() { return(BooksLogic.GetAllBook()); }
private void ReloadBooks() { AvailableBooks = BooksLogic.SearchBooks(_employee.BranchId, ISBN.TrimSafe(), onHandOnly: true); }
public void rateBook(int idB, string desc, int rate) { BooksLogic.rateBook(idB, desc, rate); }
//בזה כן משתמשים public Statistics GetAllStatisticsToBook(int IdB) { return(BooksLogic.Fullstatistics(IdB)); }
public void deleteBook(int idB) { BooksLogic.deleteBook(idB); }
public Books GetBookById(int idBook) { return(BooksLogic.getBookAndOtherDetailesToStatisckById(idBook)); }