void GetOptionList() { string subid = string.Empty; if (Request["subid"] != null && Request["subid"] != "") { subid = Common.Common.NoHtml(Request["subid"]); } else { return; } if (subid.Trim() != null && subid.Trim() != "") { LuckyAwardDAL luckdal = new LuckyAwardDAL(); DataSet optionds; if (Session["strSiteCode"].ToString() == "ADMIN") { optionds = luckdal.GetAwardList(" and a.ActID='" + subid + "' "); } else { optionds = luckdal.GetAwardList(" and b.SiteCode='" + Session["strSiteCode"].ToString() + "' and a.ActID='" + subid + "' "); } Response.Write(Dataset2Json(optionds)); } else { Response.Write("{\"success\":\"操作失败\"}"); } Response.End(); }
/// <summary> /// 加载数据 /// </summary> /// <param name="strWhere">条件</param> void LoadData(string strWhere) { txtName.Text = ""; LuckyAwardDAL dal = new LuckyAwardDAL(); DataSet ds = dal.GetAwardList(strWhere); DataView dv = ds.Tables[0].DefaultView; AspNetPager1.RecordCount = dv.Count; PagedDataSource pds = new PagedDataSource(); pds.DataSource = dv; pds.AllowPaging = true; pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1; pds.PageSize = AspNetPager1.PageSize; Repeater1.DataSource = pds; Repeater1.DataBind(); }