protected void Page_Load(object sender, EventArgs e) { try { int recordCount; string type = ConvertUtility.Trim(Request.QueryString["type"]); string estateId = ConvertUtility.Trim(Request.QueryString["code"]); this.EstateId = estateId; this.PageSize = AppSettings.PageSize; EstateCmService estateService = new EstateCmService(); EstateCm estate = estateService.GetEstateById(this.EstateId); this.TitleBar = estate.ToNavBar(false); BuildCmService buildService = new BuildCmService(); ComparedEstateType comparedEstate = estateService.GetComparedEstate(estateId); if (comparedEstate != null) { this.ComparedBuildCollection = buildService.ListComparedBuild(comparedEstate, 1, this.PageSize, out recordCount); } else { this.BuildCollection = buildService.ListBuild(this.EstateId, 1, this.PageSize, out recordCount); } this.RecordCount = recordCount; } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { try { EstateCmService estateService = new EstateCmService(); int recordCount; string type = ConvertUtility.Trim(Request.QueryString["type"]); string code = ConvertUtility.Trim(Request.QueryString["code"]); int pageIndex = ConvertUtility.ToInt(Request.QueryString["pageIndex"], 1); this.PageSize = AppSettings.PageSize; IList <EstateCmType> estateCollection = estateService.GetEstateByType(type, code, pageIndex, this.PageSize, out recordCount); this.RecordCount = recordCount; this.EstateCollection = new List <EstateCmType>(); foreach (var item in estateCollection) { EstateCmType estateType = item; OrderType orderType = estateService.GetOrder(item.EstateId); if (orderType != null) { estateType.IsOrder = true; estateType.OrderStatus = orderType.StatusId; if (estateType.OrderStatus == OrderStatus.COMPARED) { estateType.CompareDate = estateService.GetComparedEstate(estateType.EstateId).ComparedDate; } } this.EstateCollection.Add(estateType); } } catch (Exception ex) { throw ex; } }