protected void btnNext_Click(object sender, ImageClickEventArgs e)
        {
            List <int>  list = (List <int>)Session["search"];
            HiddenField ID   = FormView1.FindControl("ID") as HiddenField;
            int         id   = 0;

            if (int.TryParse(ID.Value, out id))
            {
                int index = list.FindIndex(x => x == id);
                if (index == list.Count - 1)
                {
                    index = 0;
                }
                else
                {
                    index = index + 1;
                }

                id = list[index];
                ArtGalleryDS.PictureDataTable table = PictureDL.GetById(id);
                FormView1.DataSource = table.Rows;
                FormView1.DataBind();

                ArtGalleryDS.Picture_GetWithWaterMarkDataTable table1 = PictureDL.GetWithWaterMark(id);
                FormView2.DataSource = table1.Rows;
                FormView2.DataBind();
                up1.Update();
                up2.Update();
            }
        }
예제 #2
0
        private void ProcessPicture(int id)
        {
            ArtGalleryDS.PictureDataTable table = PictureDL.GetById(id);
            FormView1.DataSource = table.Rows;
            FormView1.DataBind();

            ArtGalleryDS.Picture_GetWithWaterMarkDataTable table1 = PictureDL.GetWithWaterMark(id);
            FormView2.DataSource = table1.Rows;
            FormView2.DataBind();
        }
예제 #3
0
 /// <summary>
 /// This event occurs when the timer fires. A random picture is displayed
 /// in the right side of page
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Timer1_Tick(object sender, EventArgs e)
 {
     frmTop.DataSource = PictureDL.GetWithWaterMark(PictureDL.Random());
     frmTop.DataBind();
     up1.Update();
 }