📄 needdetail.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;
using HouseSystem.Components;
namespace HouseSystem
{
/// <summary>
/// DetailXq 的摘要说明。
/// </summary>
public class DetailXq : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label lblMsg;
protected System.Web.UI.WebControls.Label lblId;
protected System.Web.UI.WebControls.Label lblType;
protected System.Web.UI.WebControls.Label lblArea;
protected System.Web.UI.WebControls.Label lblAddr;
protected System.Web.UI.WebControls.Label lblHouseType;
protected System.Web.UI.WebControls.Label lblFYHX;
protected System.Web.UI.WebControls.Label lblZXQK;
protected System.Web.UI.WebControls.Label lblSquare;
protected System.Web.UI.WebControls.Label lblPrice;
protected System.Web.UI.WebControls.Label lblOther;
protected System.Web.UI.WebControls.Label lblLinkMan;
protected System.Web.UI.WebControls.Label lblEmail;
protected System.Web.UI.WebControls.Label lblTel1;
protected System.Web.UI.WebControls.Label lblTel2;
protected System.Web.UI.WebControls.Label lblExpire;
protected System.Web.UI.WebControls.Label lblAddTime;
protected string strArea;
protected string strFYHX;
protected string strInfoType;
protected string strTS;
protected string WebName;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
DataRow row1;
int num1;
DateTime time1;
this.WebName = ConfigurationSettings.AppSettings["My_WebName"];
string text1 = "";
string text2 = "";
if (!this.Page.IsPostBack)
{
string text3;
text1 = base.Request.QueryString["ID"];
if ((text1 == string.Empty) || (text1 == null))
{
this.lblMsg.Text = "错误,请尝试从正确的链接进入系统!";
return;
}
if (!Tools.IsInt(text1))
{
this.lblMsg.Text = "错误,请尝试从正确的链接进入系统!";
return;
}
text2 = "SELECT Type ,Area_ID ,Ht_ID ,IsAgency ,Addr ,Square ,Price ,FYHX ,ZXQK ,Other ,LinkMan ,Tel1 ,Tel2 ,Email ,Expire ,IpAddr, AddTime FROM Need WHERE ID=" + text1;
row1 = SQLDAL.SQLHelper.ExecuteDataRow(text2);
if (row1 == null)
{
this.lblMsg.Text = "\u9519\u8bef\uff0c\u5f53\u524d\u8bb0\u5f55\u5df2\u7ecf\u88ab\u5220\u9664\uff01";
return;
}
if (row1["Type"].ToString() == "1")
{
text3 = "求租";
this.strInfoType = "求租";
this.strTS = "ID号为" + text1 + "的求租信息";
}
else
{
text3 = "求购";
this.strInfoType = "求购";
this.strTS = "ID号为" + text1 + "的求购信息";
}
row1["IsAgency"].ToString();
this.strArea = this.GetAreaName(Convert.ToInt32(row1["Area_ID"].ToString()));
this.strFYHX = row1["FYHX"].ToString();
this.lblArea.Text = this.strArea;
this.lblId.Text = text1;
this.lblType.Text = text3;
this.lblAddr.Text = row1["Addr"].ToString();
this.lblHouseType.Text = this.GetHouseType(Convert.ToInt32(row1["Ht_ID"]));
this.lblFYHX.Text = this.strFYHX;
this.lblSquare.Text = row1["Square"].ToString();
this.lblOther.Text = row1["Other"].ToString();
this.lblZXQK.Text = row1["ZXQK"].ToString();
this.lblPrice.Text = row1["Price"].ToString();
num1 = int.Parse(row1["Expire"].ToString());
DataRow row2 = Components.Config.GetWebConfigInfo();
if (row2 != null)
{
if (Convert.ToInt32(row2["webtype"]) == 1)
{
this.lblLinkMan.Text = row2["weblinkman"].ToString();
this.lblEmail.Text = row2["webemail"].ToString();
this.lblTel1.Text = row2["webtel1"].ToString();
this.lblTel2.Text = row2["webtel2"].ToString();
goto Label_0368;
}
this.lblLinkMan.Text = row1["LinkMan"].ToString();
this.lblEmail.Text = row1["Email"].ToString();
this.lblTel1.Text = row1["Tel1"].ToString();
this.lblTel2.Text = row1["Tel2"].ToString();
goto Label_0368;
}
this.lblMsg.Text = "系统初始化失败!";
}
return;
Label_0368:
time1 = DateTime.Parse(row1["AddTime"].ToString());
string text4 = row1["Expire"].ToString() + "\u5929";
if (DateTime.Now > time1.AddDays((double) num1))
{
text4 = text4 + "<font color='red'>(已过期)</font>";
}
this.lblExpire.Text = text4;
this.lblAddTime.Text = time1.ToShortDateString();
RentSell.Hits(int.Parse(text1));
}
public string GetAreaName(int Area_ID)
{
return Area.GetAreaNameByID(Area_ID);
}
public string GetHouseType(int Ht_ID)
{
return HouseType.GetHouseTypeByID(Ht_ID);
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -