private void LoadData(int index) { var content = Request.QueryString["content"]; content = HttpUtility.UrlDecode(content, Encoding.UTF8); var param = string.IsNullOrWhiteSpace(content) ? "*:*" : content;//站点地址不输入参数特殊处理为全查询 var orgProvider = new OrgDataProvider(); var totalCount = orgProvider.GetCount(param); if (totalCount > 0) { lvResultPager.RecordCount = (int)totalCount; lblCount.Text = totalCount.ToString(CultureInfo.InvariantCulture); dtListOrgans.DataSource = orgProvider.GetList(param, index, PageSize); dtListOrgans.DataBind(); lvResultPager.PageSize = PageSize; lvResultPager.CurrentPageIndex = index; var intpage = this.lvResultPager.PageCount - this.lvResultPager.PageCount % PageSize; lvResultPager.NextPageText = lvResultPager.CurrentPageIndex == this.lvResultPager.PageCount ? "尾页" : "下一页"; lvResultPager.PrevPageText = lvResultPager.CurrentPageIndex == 1 ? "首页" : "上一页"; return; } dtListOrgans.DataSource = null; dtListOrgans.DataBind(); }
private void LoadData() { var id = Request.QueryString["id"]; if (string.IsNullOrWhiteSpace(id)) { return; } var orgProvider = new OrgDataProvider(); var organInfo = orgProvider.GetDetail(HttpUtility.UrlDecode(id, Encoding.UTF8)) as OrgInfoDetail; if (organInfo != null) { lblName.Text = organInfo.name; lblType.Text = organInfo.type; lblIsAuth.Text = organInfo.isAuth == true ? "已认证" : "未认证"; lblUpdateTime.Text = organInfo.updateTime != null ? organInfo.updateTime.Value.ToString("yyyy-MM-dd HH:mm") : ""; if (!string.IsNullOrWhiteSpace(organInfo.introduction)) { lblIntroduction.Text = organInfo.introduction; lblTitleIntroduction.Visible = true; showIntroduction.Visible = true; } if (!string.IsNullOrWhiteSpace(organInfo.qualification)) { lblQulificationTitle.Text = organInfo.qualification; lblTitleQulificationTitle.Visible = true; showQulification.Visible = true; } if (organInfo.contact != null) { lblContactor.Text = organInfo.contact.name; lblContactTelephone.Text = organInfo.contact.telephone; lblContactAdress.Text = organInfo.contact.address; lblTitleContactTitle.Visible = true; showContact.Visible = true; } } }