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; } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (IsCrossPagePostBack) { return; } _album = new BLL.Album(Convert.ToInt32(Request["Id"])); if (_album.Id == null) { litNotFound.Visible = true; pnlTexts.Visible = false; return; } if (_album.TextNum == 0) { litNoTexts.Visible = true; pnlTexts.Visible = false; return; } lnkArtist.NavigateUrl = "/Artist.aspx?Id=" + _album.ArtistId; lnkArtist.Text = _album.ArtistName; lnkAlbum.NavigateUrl = "/Album.aspx?Id=" + _album.Id; lnkAlbum.Text = _album.Name; rptTexts.DataSource = _album.Texts; rptTexts.DataBind(); }
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(); }