예제 #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (IsCrossPagePostBack)
            {
                return;
            }

            if (String.IsNullOrEmpty(Request["Id"]))
            {
                litNotFound.Visible = true;
                rptSongs.Visible    = false;
                return;
            }

            _artist = new BLL.Artist(Convert.ToInt32(Request["Id"]));
            if (_artist.Id == null)
            {
                litNotFound.Visible = true;
                rptSongs.Visible    = false;
            }
            else
            {
                rptSongs.DataSource = _artist.Texts;
                rptSongs.DataBind();
            }
        }
예제 #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (IsCrossPagePostBack)
            {
                return;
            }

            _album = new BLL.Album(Convert.ToInt32(Request["Id"]));
            BLL.Counter.CountAlbum(Convert.ToInt32(Request["Id"]));

// ReSharper disable PossibleInvalidOperationException
            var artistId = !String.IsNullOrEmpty(Request["Art"]) ? Convert.ToInt32(Request["Art"]) : _album.ArtistId.Value;

// ReSharper restore PossibleInvalidOperationException

            _artist = new BLL.Artist(artistId);

            if (_album.Id == null || !ShowInfo())
            {
                litNotFound.Visible = true;
                plhAlbum.Visible    = false;
                pnlInfo.Visible     = false;
                Master.Title        = "*Альбом не найден";
            }
            else
            {
                Master.Title = "*" + _album.Name + " - " + _artist.Name;
            }
        }
예제 #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (IsCrossPagePostBack)
            {
                return;
            }

            if (String.IsNullOrEmpty(Request["Id"]) && !String.IsNullOrEmpty(Request["ArtistId"]))
            {
                Redirect("/Artist.aspx?Id=" + Request["ArtistId"]);   //google sends artistid for some reason
            }
            else
            {
                _artist = new BLL.Artist(RequestArtistId);
                BLL.Counter.CountArtist(RequestArtistId);
                if (_artist.TextNum == 0)
                {
                    plhFooter.Visible = false;
                }

                if (_artist.Id == null || !ShowAlbums())
                {
                    litNotFound.Visible = true;
                    pnlArtist.Visible   = false;
                    Master.Title        = "*Исполнитель не найден";
                }
                else
                {
                    Master.Title = "*" + _artist.Name + " - альбомы";
                }

                if (!String.IsNullOrEmpty(_artist.Info))
                {
                    litInfo.Text = _artist.Info;
                }
                else
                {
                    pnlInfo.Visible = false;
                }

                if (!String.IsNullOrEmpty(_artist.Links))
                {
                    litLinks.Text = _artist.Links;
                }
                else
                {
                    pnlLinks.Visible = false;
                }
            }
        }
예제 #4
0
        private void EditUserOrders(int orderId)
        {
            OrderId = orderId;

            var order  = new UserOrder(orderId);
            var artist = new BLL.Artist(order.ArtistName);
// ReSharper disable PossibleInvalidOperationException
// ReSharper disable RedundantNameQualifier
            var album = new BLL.Album(artist.Id.Value, order.AlbumName);
            var song  = new BLL.Song(album.Id.Value, order.SongName);

// ReSharper restore RedundantNameQualifier
// ReSharper restore PossibleInvalidOperationException

            FileBrowser1.CurrentPath = album.RootPath;

            litUser.Text     = order.UserId + "/" + order.Id;
            litArtist.Text   = artist.Name;
            litAlbum.Text    = album.Name;
            litSong.Text     = song.Name;
            litComments.Text = order.Comments;

            var i = -1;

            lstFiles.Items.Clear();
            foreach (var sd in song.Sounds)
            {
                var li = new ListItem(sd.Path, sd.Id.ToString());
                lstFiles.Items.Add(li);
                if (sd.Path.EndsWith(".mp3") || sd.Path.EndsWith(".wma") || sd.Path.EndsWith(".ogg") || sd.Path.EndsWith(".wav"))
                {
                    i = lstFiles.Items.Count - 1;
                }
            }
            if (i >= 0)
            {
                lstFiles.SelectedIndex = i;
            }

            rptUserOrders.DataSource = DB.ExecuteDataTable("exec GetCurrentUserOrders @OrderId=" + order.Id);
            rptUserOrders.DataBind();
        }