Exemple #1
0
 private void BigAlbumView_Load(object sender, EventArgs e)
 {
     //Slide
     if (slideIndex != -1)
     {
         if (slideIndex != 0)
         {
             SlideLeftButton.Visible = true; SlideLeftButton.FlatAppearance.BorderSize = 0;
         }
         if (slideIndex != slideALbums.Count - 1)
         {
             SlideRightButton.Visible = true; SlideRightButton.FlatAppearance.BorderSize = 0;
         }
         SlideInfo.Visible   = true;
         SlideInfo.Text      = $"({slideIndex + 1}/{slideALbums.Count})";
         CloseButton.Visible = false;
         PdfSave.Visible     = false;
         Edit.Visible        = false;
         Delete.Visible      = false;
     }
     //
     pictureBox1.Image    = ImageMethods.ConvertByteArrayToImage(currentAlbum.CoverPhoto);
     pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
     InitializeData();
     BigAlbumView_SizeChanged(sender, e);
 }
        private void EnterDataFromAlbum(int AlbumId)
        {
            MusicAlbumsGuideDB context = new MusicAlbumsGuideDB();
            Album current = context.Albums.Include(p => p.Author).Include(p => p.Carrier).Include(p => p.Genre).Include(p => p.Type).Include(p => p.ReleasingLabel).Where(p => p.AlbumId == AlbumId).Single();

            CoverAlbum.Image         = ImageMethods.ConvertByteArrayToImage(current.CoverPhoto);
            CoverAlbum.SizeMode      = PictureBoxSizeMode.StretchImage;
            NameTextBox.Text         = current.Name;
            GenreComboBox.Text       = current.Genre.Name;
            ReleaseYearTextBox.Text  = current.ReleaseYear.ToString();
            CarrierComboBox.Text     = current.Carrier.Name;
            TypeComboBox.Text        = current.Type.Name;
            AuthorTextBox.Text       = current.Author.Name;
            TrackCountTextBox.Text   = current.TrackCount.ToString();
            ReleaseLabelTextBox.Text = current.ReleasingLabel.Name;
        }
Exemple #3
0
 public void SetInitVariables(Form1 parent, Album album)
 {
     parentForm   = parent;
     currentAlbum = album;
     //
     pictureBox1.Image = ImageMethods.ConvertByteArrayToImage(currentAlbum.CoverPhoto);
     if (currentAlbum.Name.Length <= 20)
     {
         AlbumName.Text = currentAlbum.Name;
     }
     else
     {
         string name = default(string);
         for (int i = 0; i < 21; i++)
         {
             name += currentAlbum.Name[i];
         }
         AlbumName.Text = name;
     }
     ReleaseYear.Text = currentAlbum.ReleaseYear.ToString() + " г.";
     Author.Text      = currentAlbum.Author.Name;
 }