Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AlbumListGenerator.SelectCommand = BuildAlbumQuery();
            var list = AlbumListGenerator.Select(DataSourceSelectArguments.Empty);

            int count = 0;
            foreach (DataRowView row in list)
            {
                count++;
            }

            Random r = new Random();
            int rnd = r.Next(count);
            string ah = "";

            count = 0;
            foreach (DataRowView row in list)
            {
                if (count == 0)
                {
                    ah = (string)row["AlbumHash"];
                }

                if (count == rnd)
                {
                    ah = (string)row["AlbumHash"];
                    break;
                }

                count++;
            }
            m_coa = new CommonOneAlbum("", ah, AlbumListGenerator, Response);
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NameValueCollection coll = Request.QueryString;
            string subquery = Helper.GetQueryValue(coll, "qry", "");
            string albumHash = Helper.GetQueryValue(coll, "ah", "");

            m_coa = new CommonOneAlbum(subquery, albumHash, AlbumListGenerator, Response);
        }