点击回首页
我的浏览记录 | | 帮助?
当前位置:

源码截图

源码目录树

当前路径:LetSearch/ReadHouse.aspx.cs     using System;
using System.Text;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using InsApp.WebSearch;
using InsApp.Linkdata;

public partial class ReadHouse : System.Web.UI.Page
{
    public string[] WebSystem = new string[4];
    InsApp.WebSearch.ReadWebSiteXml N_read = new ReadWebSiteXml();
    InsApp.Linkdata.DBdata Mydb = new DBdata();
    public string GetJsValue;
    protected void Page_Load(object sender, EventArgs e)
    {
        WebSystem = N_read.ReadWebSiteTitle();
        Ajax.Utility.RegisterTypeForAjax(typeof(ReadHouse));
        if (!Page.IsPostBack)
        {
            if (Request.ServerVariables["Request_Method"] == "POST")
            {
                if (Request.QueryString["InfoID"] != null && Request.QueryString["InfoID"] != "")
                {
                    GetJsValue = Request.QueryString["InfoID"];
                }
            }
        }

    }

    #region string Server_Read_TitleList(WebID)根据参数读取某网站下的房源主题列表
    [Ajax.AjaxMethod]
    public string Server_Read_TitleList(string WebID)
    {
        StringBuilder ReturnTitleList = new StringBuilder();
        string Read_SiteList_Sql = string.Empty;
        string Unit = string.Empty;

        if (WebID == "rent")
        {
            Unit = "元/月";
        }
        else
        {
            Unit = "万元";
        }

        if (WebID == null || WebID == "")
        {
            Read_SiteList_Sql = "select top 400  H_AutoID,H_Address,H_ZjPrice,H_Huxing,H_AutoTime,H_Area_ID,H_URl from HouseInfo where H_Type='sale' order by H_AutoTime desc ";
        }
        else
        {
            Read_SiteList_Sql = "select  top 500  H_AutoID,H_Address,H_ZjPrice,H_Huxing,H_AutoTime,H_Area_ID,H_URl from HouseInfo where H_Type='" + WebID + "' order by H_AutoTime desc ";
        }

        string[] GetArray = Mydb.GetSqlCmd_Array(Read_SiteList_Sql);
        ReturnTitleList.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> ");

        string FormatDate = string.Empty;

        if (GetArray != null)
        {
            for (int i = 0; i < GetArray.Length; i +=7)
            {
                FormatDate = Convert.ToDateTime(GetArray[i + 4]).ToString("yyyy-MM-dd");

                ReturnTitleList.Append("<tr><td width=\"60%\"><a href=\"javascript:S_Read_Content('" + GetArray[i] + "');void(0);\">"
                +GetArray[i + 5] +" "+GetArray[i + 1] +" "+ GetArray[i + 2] + Unit+" " + GetArray[i + 3] + "</a></td>" +
                "<td width=\"100\">" + FormatDate + "</td><td width=\"50\"><a href='" + GetArray[i + 6] + "' target='_blank' title='" + GetArray[i + 1] + "'>查看源</a></td></tr>");
            }
            ReturnTitleList.Append("</table>");
            return ReturnTitleList.ToString();
        }
        else
        {
            return "数据正在更新中...";
        }
    }

    #endregion

    #region string Server_Content(string WebID)读取详细内容
    [Ajax.AjaxMethod]
    public string Server_Content(string WebID)
    {
        StringBuilder ReturnTitleList = new StringBuilder();
        string Unit = string.Empty;

        string Read_SiteList_Sql = string.Empty;
        if (WebID == null || WebID == "")
        {
            Read_SiteList_Sql = "select top 1 H_URl,H_Address,H_PjPrice,H_ZjPrice,H_Huxing,H_Mianji,H_Area_ID,H_BuildYear,H_Quan" +//8
                ",H_Cx,H_Lc,H_Alc,H_Shinei,H_Memo,H_lr,H_LrPhone,H_Type from houseinfo order by  H_AutoTime desc";
        }
        else
        {
            Read_SiteList_Sql = "select  H_URl,H_Address,H_PjPrice,H_ZjPrice,H_Huxing,H_Mianji,H_Area_ID,H_BuildYear,H_Quan" +
            ",H_Cx,H_Lc,H_Alc,H_Shinei,H_Memo,H_lr,H_LrPhone,H_Type from houseinfo where H_AutoID='" + WebID + "' order by  H_AutoTime desc";
        }
        string[] GetArray = Mydb.GetSqlCmd_Array(Read_SiteList_Sql);
        if (GetArray != null)
        {

            for (int i = 0; i < GetArray.Length; i += 17)
            {

                if (GetArray[i+16] == "rent")
                {
                    Unit = "元/月";
                }
                else
                {
                    Unit = "万元";
                }

                ReturnTitleList.Append("<p style=\"linehight:150%; font-size:14px;\">信息来源:<a href=\""+GetArray[i]+"\" target='_blank'>查看内容</a><br/>");
                ReturnTitleList.Append("房屋地址:" +GetArray[i + 6]+" "+ GetArray[i + 1] + "    户&nbsp;&nbsp;型:" + GetArray[i + 4] + "<br/>");
                ReturnTitleList.Append("价&nbsp;&nbsp;格:" + GetArray[i + 3] + Unit + "    均价" + GetArray[i + 2] + "元<br/>");
                ReturnTitleList.Append("面&nbsp;&nbsp;积:" + GetArray[i + 5] + "平米<br/>");
                ReturnTitleList.Append("建筑年代:" + GetArray[i + 7] + "    产权性质:" + GetArray[i + 8] + "   朝向:" + GetArray[i +9] + "<br/>");
                ReturnTitleList.Append("楼&nbsp;&nbsp;层:第" + GetArray[i + 10] + "层/共" + GetArray[i + 11] + "层<br/>");
                ReturnTitleList.Append("室内情况:" + GetArray[i+12]+"<br/>");
                ReturnTitleList.Append("备&nbsp;&nbsp;注:" + GetArray[i + 13] + "<br/>");
                ReturnTitleList.Append("联系人:" + GetArray[i + 14] + "    联系电话:" + GetArray[i + 15]+"<br/></p>");
            }

            return ReturnTitleList.ToString();
        }
        else
        {
            return "数据正在更新中...";
        }
    }

    #endregion 
}
关于我们 | 顾问团队 | 发展历程 | 联系我们 | 源码上传
联系电话(Tel):4008-010-151(免长途) 企业QQ:2852517674
地址:北京市海淀区中关村鼎好大厦A座二层 邮编:100080
Room A-801,Dinghao Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2015. 京ICP备09089570号 | 京公网安备11010702000869号
分享该页面
关闭侧边栏