private void SetAuthor(string pStrAuthor)
      {
          //get list from database
          string strAuthor = AuthorLib.ToString(authorlib.ShowAuthor());

          autoCompleteBox_Author.SetData(strAuthor);
      }
      private void Load(Book pBook)
      {
          string strAuthor = "AgrondPham;";

          if (pBook.Authors != null)
          {
              strAuthor = AuthorLib.ToString(pBook.Authors);
              autoCompleteBox_Author.Text = strAuthor;
              SetAuthor(strAuthor);
          }
          if (pBook.Publisher != null)
          {
              autoCompleteBox_Publisher.Text = pBook.Publisher.pbl_Name;
              SetPublisher(pBook.Publisher.pbl_Name);
          }

          txtISBN.Text    = pBook.bok_ISBN;
          txtTitle.Text   = pBook.bok_Title;
          txtEdition.Text = pBook.bok_Edition.ToString();

          ucComBoxVolume.Text = pBook.bok_Volume.ToString();
          ucComBoxYear.Text   = pBook.bok_Year.ToString();
          rankComponent1.setText(Rank.RankNumber(pBook.bok_Rank));

          txtReview.AppendText(pBook.bok_Review);
          if (pBook.bok_ImageURl != "" && pBook.bok_ImageURl != null)
          {
              SetPic(pBook.bok_ImageURl);
          }
          else
          {
              SetPic("pack://application:,,,/Images/no_picture_available.png");
          }
          //set old for edit
          if (!_IsReload)
          {
              _OldAuthor    = ConvertData.ToList(strAuthor)[0];
              _OldTitle     = pBook.bok_Title;
              _OldEbookFile = pBook.bok_Location;
          }
      }
        private void setData(Book pBook)
        {
            string strAuthor = AuthorLib.ToString(pBook.Authors);

            lbl_Author.Content = strAuthor;

            lbl_Title.Content     = pBook.bok_Title;
            lbl_Edition.Content   = pBook.bok_Edition;
            lbl_Publisher.Content = pBook.Publisher.pbl_Name;
            lbl_Volume.Content    = pBook.bok_Volume;
            lbl_Year.Content      = pBook.bok_Year;
            //pass variable;
            _strFileType = pBook.bok_Location;
            _strAuthor   = strAuthor;
            _strTitle    = pBook.bok_Title;
            if (pBook.bok_ImageURl != null && pBook.bok_ImageURl != "")
            {
                try
                {
                    BitmapImage bi = new BitmapImage();
                    bi.BeginInit();
                    bi.UriSource   = new Uri(pBook.bok_ImageURl, UriKind.RelativeOrAbsolute);
                    bi.CacheOption = BitmapCacheOption.OnLoad;
                    bi.EndInit();
                    img_Cover.Source = bi;
                }
                catch (Exception e) {
                    ///Error
                    //load default image when you do not find the image
                    BitmapImage bi = new BitmapImage();
                    bi.BeginInit();
                    bi.UriSource = new Uri("pack://application:,,,/Images/no_picture_available.png", UriKind.RelativeOrAbsolute);
                    bi.EndInit();
                    img_Cover.Source   = bi;
                    img_Cover.Stretch  = Stretch.Uniform;
                    pBook.bok_ImageURl = "pack://application:,,,/Images/no_picture_available.png";
                }
            }
        }
        private void LoadData()
        {
            txt_Author.Text    = AuthorLib.ToString(_book.Authors);
            txt_Edition.Text   = _book.bok_Edition.ToString();
            txt_ISBN.Text      = _book.bok_ISBN;
            txt_Language.Text  = _book.Language.lng_Name;
            txt_Publisher.Text = _book.Publisher.pbl_Name;
            txt_Year.Text      = _book.bok_Year.ToString();
            txt_Review.AppendText(_book.bok_Review);
            txt_Tag.Text    = ConvertData.ToString(_book.Tags);
            txt_Title.Text  = _book.bok_Title;
            txt_Volume.Text = _book.bok_Volume.ToString();

            SetPic(img_Rank, _book.bok_Rank);
            SetPic(img_Cover, _book.bok_ImageURl);

            //set value to create location for e-book
            string strAuthor = AuthorLib.ToString(_book.Authors);

            _OldAuthor    = ConvertData.ToList(strAuthor)[0];
            _OldTitle     = _book.bok_Title;
            pOldDirectory = CreateOldDirectory(_OldAuthor, _OldTitle);
        }
        private void btn_Read_Click(object sender, RoutedEventArgs e)
        {
            string url = Naming.GetFileURL(Naming.GetFirstAuthor(AuthorLib.ToString(_book.Authors)), _book.bok_Title, _book.bok_Location);

            Process.Start(url);
        }