| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using CB.Common;
- using CB.Data;
- using CB.Entity;
- using CB.Framework;
- namespace CB.Admin.Plugins.TVServer
- {
- public partial class TVUserList : AdminPage
- {
- public IList<AreaInfo> ListArea = new List<AreaInfo>();
- public IList<LotteryInfo> ListLottery = new List<LotteryInfo>();
- public IList<TrendChartInfo> ListTrendChart = new List<TrendChartInfo>();
- protected void Page_Load(object sender, EventArgs e)
- {
- ListArea = AreaService.ToList();
- ListLottery = LotteryService.ToList();
- ListTrendChart = TrendChartService.ToList();
- if (!Page.IsPostBack)
- {
- InitData();
- }
- }
- protected override void InitData()
- {
- BindRepeaterList();
- }
- protected override void BindRepeaterList()
- {
- int recordCount;
- repeaterList.DataSource = null;
- var list = CB.Data.TVUserService.ToPaging(new Entity.TVUserInfo(), AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, out recordCount);
- repeaterList.DataSource = list;
- repeaterList.DataBind();
- }
- protected void repeaterList_ItemCommand(object source, RepeaterCommandEventArgs e)
- {
- if ("dndel" == e.CommandName)
- {
- if (CB.Data.TVUserService.Delete(TypeConverter.ObjectToInt(e.CommandArgument)))
- Logs("删除电视走势图用户成功", string.Format("用户[ID={0}]", e.CommandArgument));
- BindRepeaterList();
- }
- }
- protected void AspNetPager1_PageChanged(object sender, EventArgs e)
- {
- BindRepeaterList();
- }
- protected string BindAreaName(int AreaId)
- {
- foreach (var item in ListArea)
- {
- if (item.Id == AreaId)
- {
- return item.Name;
- }
- }
- return "";
- }
- protected string BindLotteryName(int LotteryId)
- {
- foreach (var item in ListLottery)
- {
- if (item.Id == LotteryId)
- {
- return item.Name;
- }
- }
- return "";
- }
- protected string BindTrendChartName(int ChartId)
- {
- foreach (var item in ListTrendChart)
- {
- if (item.Id == ChartId)
- {
- return item.Name;
- }
- }
- return "";
- }
- }
- }
|