WebApplication/Company.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication
{
    public partial class Company : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {

bind();
                
            }
        }

        void bind()
        {
            AspNetPager1.RecordCount = int.Parse(DBUtility.DbHelperSQL.GetSingle("select count(1) from Company where Verify = 1 ").ToString());
            DataTable dt = DBUtility.DbHelperSQL.Query(@"select *,IsNULL((select top 1 Address from House where House.InfoID = Contract.HouseInfoID and Verify = 1),'') as CompanyAddress
from [Contract]
 left join Company on Contract.CompanyInfoID = Company.InfoID
  where Company.Verify = 1 order by Company.InfoID desc ", AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize).Tables[0];
            Repeater1.DataSource = dt;
            Repeater1.DataBind();
            if (AspNetPager1.RecordCount <= 12) { AspNetPager1.Visible = false; }
        }


        public string ShowDisplay(int count)
        {
            if (count == 0) { return "grid"; }
            else { return "none"; }
        }

        protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
        {
            AspNetPager1.CurrentPageIndex = e.NewPageIndex;
            bind();
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。