Beispiel #1
0
 private void BindCorp()
 {
     if (!string.IsNullOrEmpty(this.dropType.SelectedValue))
     {
         XPMBasicContactCorpService xPMBasicContactCorpService = new XPMBasicContactCorpService();
         int corpTypeId = System.Convert.ToInt32(this.dropType.SelectedValue);
         System.Collections.Generic.IList <XPMBasicContactCorp> list = xPMBasicContactCorpService.GetByCorpTypeId(corpTypeId);
         string corpName = this.txtName.Text.Trim();
         if (!string.IsNullOrEmpty(corpName))
         {
             list = (
                 from c in list
                 where c.CorpName.Contains(corpName)
                 select c).ToList <XPMBasicContactCorp>();
         }
         this.AspNetPager1.RecordCount = list.Count;
         this.gvwCodeList.DataSource   = list.Skip((this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize).Take(this.AspNetPager1.PageSize);
         this.gvwCodeList.DataBind();
     }
 }