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; } }
public DataTable ListComparedBuild(ComparedEstateType comparedEstate, int pageIndex, int pageSize, out int recordCount) { string funMsg = "function: ListComparedBuild(ComparedEstateType comparedEstate, int pageIndex, int pageSize, out int recordCount)" + FileUtility.NewLine + _ClassMsg; try { string procedure = "spListComapredBuild"; return(DbUtility.GetDataTableByProc(procedure, this.ConnStr, out recordCount, new SqlParameter[] { new SqlParameter { ParameterName = "@estateId", SqlDbType = SqlDbType.VarChar, Value = comparedEstate.EstateId }, new SqlParameter { ParameterName = "@framework_EstateId", SqlDbType = SqlDbType.VarChar, Value = comparedEstate.Framework_EstateId }, new SqlParameter { ParameterName = "@pageIndex", SqlDbType = SqlDbType.Int, Value = pageIndex }, new SqlParameter { ParameterName = "@pageSize", SqlDbType = SqlDbType.Int, Value = pageSize }, new SqlParameter { ParameterName = "@recordCount", SqlDbType = SqlDbType.Int, Direction = ParameterDirection.Output } })); } catch (Exception ex) { throw ex; } }
public ComparedEstateType GetComparedEstate(string estateId) { string funMsg = "function: GetComparedEstate(string estateId)" + FileUtility.NewLine + _ClassMsg; try { DataRow row = _DbService.GetComparedEstate(estateId); if (row != null) { ComparedEstateType estateType = new ComparedEstateType(row); return(estateType); } return(null); } catch (Exception ex) { throw ex; } }
public IList <ComparedBuildType> ListComparedBuild(ComparedEstateType comparedEstate, int pageIndex, int pageSize, out int recordCount) { string funMsg = "function: ListComparedBuild(ComparedEstateType comparedEstate, int pageIndex, int pageSize, out int recordCount)" + FileUtility.NewLine + _ClassMsg; try { DataTable table = _DbService.ListComparedBuild(comparedEstate, pageIndex, pageSize, out recordCount); List <ComparedBuildType> result = new List <ComparedBuildType>(); if (table != null && table.Rows.Count > 0) { foreach (DataRow row in table.Rows) { result.Add(new ComparedBuildType(row)); } } return(result); } catch (Exception ex) { throw ex; } }
public ComparedEstate(ComparedEstateType estateType) : base(estateType) { this.Scope = new Scope(this.ScopeId); }