1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL.Promotion;
using CY.Model;
using System.Data;
using CY.Infrastructure.Common;
using CY.Infrastructure.Query;
namespace CY.WebForm.Pages.member
{
    public partial class PromotionCode : BasePage
    {
 
        Promotion_PictureBLL _Promotion_PictureBLL = null;
        Promotion_ArticleInfoBLL _Promotion_ArticleInfoBLL = null;
        public string HtmlCode = "";
        public PromotionCode()
        {
            _Promotion_PictureBLL = new Promotion_PictureBLL();
            _Promotion_ArticleInfoBLL = new Promotion_ArticleInfoBLL();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            InitialData();
            UCPager1.AspNetPager.PageChanged += AspNetPager1_PageChanged;
            if (!IsPostBack)
            {
 
                BindList();
            }
        }
        protected void InitialData()
        {
 
            DataTable ds = _Promotion_PictureBLL.SelectModelList();
            for (int i = 0; i < ds.Rows.Count; i++)
            {
                string ImgTruePath =ds.Rows[i]["FileId"].ToString2();
                //this.rButtonSize.Items.Add(new ListItem(ds.Rows[i]["Height"].ToString2() + "*" + ds.Rows[i]["Width"].ToString2(), ds.Rows[i]["FileId"].ToString2()));
                HtmlCode += "<input type='radio' class='ImgClick' name='ra' imgurl='" + ImgTruePath + "' imgwidth='" + ds.Rows[i]["Width"].ToString2() + "' imgheight='" + ds.Rows[i]["Height"].ToString2() + "' imgmemberid='" + CurrentUser.MemberId + "' value= '" + ds.Rows[i]["Keyid"].ToString2() + "'/>" + ds.Rows[i]["Width"].ToString2() + "*" + ds.Rows[i]["Height"].ToString2();
            }
 
            //this.rButtonSize.Items[0].Selected = true;
            //this.rButtonSize.DataBind();
            if (ds != null && ds.Rows.Count > 0)
            {
                this.imgAd.ImageUrl = ds.Rows[0]["FileId"].ToString2();
                this.imgAd.Height = ds.Rows[0]["Height"].ToInt32() ?? 0;
                this.imgAd.Width = ds.Rows[0]["Width"].ToInt32() ?? 0;
                this.imgAd.DataBind();
                this.txtCode.Value = "<a href='http://www.cyin.cn/Home/Index.htm?M_PromoteNumber='" + CurrentUser.MemberId + "' style='cursor: pointer;'><img src='http://www.cyin.cn" + ds.Rows[0]["FileId"].ToString2() + "' alt='网站推广图片' width='" + ds.Rows[0]["Width"].ToInt32() + "'height='" + ds.Rows[0]["Height"].ToInt32() + "'></a>";
            }
 
        }
        private void BindList()
        {
 
            Pagination pa = new Pagination();
            pa.PageSize = this.UCPager1.AspNetPager.PageSize;
            pa.PageIndex = this.UCPager1.AspNetPager.CurrentPageIndex;
 
            this.RepArticleInfoList.DataSource = _Promotion_ArticleInfoBLL.SelectModelPage(pa);
 
            this.RepArticleInfoList.DataBind();
            UCPager1.AspNetPager.RecordCount = pa.RecordCount;
 
        }
 
        protected void AspNetPager1_PageChanged(object src, EventArgs e)
        {
            BindList();
        }
 
 
    }
}