日期:2014-05-18 浏览次数:20403 次
function secondLoadAjax(allTime){ $.ajax({ url:"SearchSecondInfo", datatype:"json", data:"startTime=" + allTime, success:function(sucText){ $("#ProjectTwiceSearchTable").empty(); $("#ProjectTwiceSearchTable").append("<tr bgcolor='#F1F1EF'><td width='11%' rowspan='2'> </td><td width='20%' rowspan='2' align='center' bgcolor='#F1F1EF'>二手房面积<br />(平方米)</td><td colspan='2' align='center' bgcolor='#F1F1EF'>其中:二手住宅 </td><td width='20%' rowspan='2' align='center' bgcolor='#F1F1EF'>二手住宅平均每套面积<br />(平方米/套)</td></tr><tr bgcolor='#F1F1EF'><td width='13%' align='center' bgcolor='#F1F1EF'>套数(套)</td><td width='20%' align='center' bgcolor='#F1F1EF'>面积(平方米)</td></tr>"); var json = eval("("+sucText+")"); if(json.length <= 0){ $("#ProjectTwiceSearchTable").append("<tr><td colspan='5'>暂无数据</td></tr>"); }else{ for(var i = 0;i < json.length; i++){ $("#ProjectTwiceSearchTable").append("<tr bgcolor='#FFFFFF'><td align='center' bgcolor='#FFFFFF'>"+json[i].District+"</td><td align='center' bgcolor='#FFFFFF'>"+json[i].CommodityArea+"</td> <td align='center' bgcolor='#FFFFFF'>"+json[i].HouseCount+"</td><td align='center' bgcolor='#FFFFFF'>"+json[i].HouseArea+"</td> <td>"+json[i].HouseAvg+"</td>"); } } }, error:function(errorText){ alert("请求超时,请稍后重试!"); } }); }
TodaySecondSellingBll tsbll = BllFactory.CreateTodaySecondSellingBll(); string startTime = context.Request["startTime"]; DataTable dt = tsbll.FindBetweenTime(startTime); IList<TodaySecondSelling> list = new List<TodaySecondSelling>(); foreach (DataRow item in dt.Rows) { TodaySecondSelling to = new TodaySecondSelling(); to.Id = Convert.ToInt32(item.ItemArray[0]); to.District = item.ItemArray[2].ToString(); to.CommodityArea = Convert.ToDouble(item.ItemArray[3]); to.HouseCount = Convert.ToInt32(item.ItemArray[4]); to.HouseArea = Convert.ToDouble(item.ItemArray[5]); to.HouseAvg = int.Parse(item.ItemArray[7].ToString().Substring(0, item.ItemArray[7].ToString().LastIndexOf("."))); list.Add(to); } JavaScriptSerializer s = new JavaScriptSerializer(); context.Response.Write(s.Serialize(list));