public void AddTrading_CorrectData_TrueReturned()
        {
            //Arrange
            int    book_id   = 3;
            string ticket    = "А-1234-21";
            string delivery  = "2002.03.01";
            string reception = "2002.04.01";
            string login     = "******";

            int oldClientsLength = dbHelper.context.trading.Count();

            //Act
            if (tradingController.AddNewTrading(book_id, ticket, Convert.ToDateTime(delivery), Convert.ToDateTime(reception), login))
            {
                int updatedClientsLength = dbHelper.context.trading.Count();
                var selectString         = dbHelper.context.trading.OrderByDescending(t => t.trading_id).FirstOrDefault().trading_id;
                tradingController.RemoveTrading(selectString);

                //Assert
                Assert.AreEqual(oldClientsLength + 1, updatedClientsLength);
            }
        }
        /// <summary>
        /// Событие при клике на кнопку "Одобрить"
        /// </summary>
        private void ApproveBtn_Click(object sender, RoutedEventArgs e)
        {
            if (WaitingBooksDataGrid.SelectedItem == null)
            {
                MessageBox.Show("Не выбрано ни одной книги");
            }
            else
            {
                List <quantity> booksQuantity = new List <quantity>();

                var       firstSelectedCellContent  = new DataGridCellInfo(WaitingBooksDataGrid.SelectedItem, WaitingBooksDataGrid.Columns[0]);
                TextBlock selectedWaiting           = firstSelectedCellContent.Column.GetCellContent(firstSelectedCellContent.Item) as TextBlock;
                var       secondSelectedCellContent = new DataGridCellInfo(WaitingBooksDataGrid.SelectedItem, WaitingBooksDataGrid.Columns[1]);
                TextBlock selectedBook             = secondSelectedCellContent.Column.GetCellContent(secondSelectedCellContent.Item) as TextBlock;
                var       thirdSelectedCellContent = new DataGridCellInfo(WaitingBooksDataGrid.SelectedItem, WaitingBooksDataGrid.Columns[2]);
                TextBlock selectedTicket           = thirdSelectedCellContent.Column.GetCellContent(thirdSelectedCellContent.Item) as TextBlock;
                var       fourSelectedCellContent  = new DataGridCellInfo(WaitingBooksDataGrid.SelectedItem, WaitingBooksDataGrid.Columns[3]);
                TextBlock selectedLogin            = fourSelectedCellContent.Column.GetCellContent(fourSelectedCellContent.Item) as TextBlock;

                if (tradingController.AddNewTrading(Convert.ToInt32(selectedBook.Text), selectedTicket.Text, DateTime.Now, DateTime.Now.AddMonths(1), selectedLogin.Text))
                {
                    booksQuantity = quantityController.GetQuantity(Convert.ToInt32(selectedBook.Text));
                    if (quantityController.ChangeQuantityMinus(Convert.ToInt32(selectedBook.Text), booksQuantity))
                    {
                        if (booksController.AssignIdTradingToBook(Convert.ToInt32(selectedBook.Text), tradingController.GetNeededTradingId(Convert.ToInt32(selectedBook.Text))))
                        {
                            if (clientsController.AddTradingIdToCLient(selectedLogin.Text, tradingController.GetNeededTradingId(Convert.ToInt32(selectedBook.Text))))
                            {
                                if (formularController.AddFormularInfo(selectedTicket.Text, DateTime.Now, DateTime.Now.AddMonths(1), Convert.ToInt32(selectedBook.Text)))
                                {
                                    if (waitingController.DeleteEaitingBook(Convert.ToInt32(selectedWaiting.Text)))
                                    {
                                        WaitingBooksDataGrid.ItemsSource = waitingController.GetWaitingInfo();
                                        MessageBox.Show("Книга была выдана пользователю:" + selectedLogin.Text);
                                        TradingDataGrid.ItemsSource      = tradingController.GetTradingInfo();
                                        BookDataGrid.ItemsSource         = booksController.BooksInfoOutput();
                                        TradingClientsGrid.ItemsSource   = clientsController.GetClientsWithTrading();
                                        WaitingBooksDataGrid.ItemsSource = waitingController.GetWaitingInfo();
                                    }
                                    else
                                    {
                                        MessageBox.Show("Ошибка базы данных попроьуйте позже.");
                                    }
                                }
                                else
                                {
                                    MessageBox.Show("Формуляр не был заполнен");
                                }
                            }
                            else
                            {
                                MessageBox.Show("Ошибка базы данных, попробуйте позже.");
                            }
                        }
                        else
                        {
                            MessageBox.Show("Номер обмена не был присвоен выбранной книге((");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Количетсво не было перезаписано");
                    }
                }
                else
                {
                    MessageBox.Show("Выдача не была произведена, попробуйте позже");
                }
            }
        }