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; } }
static void CompareEstate(string agencyCom_EstateId) { Console.WriteLine("时间 : [{0}], 比较楼盘 [{1}]", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), agencyCom_EstateId); EstateCmService estateCmService = new EstateCmService(); EstateCmType agencyComEstate = estateCmService.GetEstateById(agencyCom_EstateId); EstateFwService estateFwService = new EstateFwService(); EstateFwType frameworkEstate = estateFwService.GetEstateByCm(agencyCom_EstateId); estateCmService.InsertComparedEstate(agencyComEstate, frameworkEstate, ComparedStatus.DEFAULT); CompareBuild(agencyCom_EstateId); }
public bool InsertComparedEstate(EstateCmType b, EstateFwType c, int p) { string funMsg = "function: InsertComparedEstate(EstateCmType b, EstateFwType c, int p)" + FileUtility.NewLine + _ClassMsg; try { int effected = _DbService.InsertComparedEstate(b, c, p); return(effected > 0); } catch (Exception ex) { throw ex; } }
public EstateCm GetEstateById(string estateId) { string funMsg = "Function: GetEstateById(string estateId)" + FileUtility.NewLine + _ClassMsg; try { EstateCmType centaEstateType = GetEstateTypeById(estateId); if (centaEstateType == null) { return(null); } return(new EstateCm(centaEstateType)); } catch (Exception ex) { throw ex; } }
public int InsertComparedEstate(EstateCmType b, EstateFwType c, int p) { string funMsg = "function: InsertComparedEstate(EstateCmType b, EstateFwType c, int p)" + FileUtility.NewLine + _ClassMsg; try { string procedure = "spInsertComparedEstate"; return(DbUtility.ExecuteNonQueryByProc(procedure, this.ConnStr, new SqlParameter[] { new SqlParameter { ParameterName = "@estateId", SqlDbType = SqlDbType.VarChar, Value = b.EstateId }, new SqlParameter { ParameterName = "@scopeId", SqlDbType = SqlDbType.Char, Value = b.ScopeId }, new SqlParameter { ParameterName = "@estateName", SqlDbType = SqlDbType.NVarChar, Value = b.EstateName }, new SqlParameter { ParameterName = "@address", SqlDbType = SqlDbType.NVarChar, Value = b.Address }, new SqlParameter { ParameterName = "@framework_EstateId", SqlDbType = SqlDbType.Char, Value = c.EstateId }, new SqlParameter { ParameterName = "@framework_ScopeId", SqlDbType = SqlDbType.Char, Value = c.ScopeId }, new SqlParameter { ParameterName = "@framework_EstateName", SqlDbType = SqlDbType.NVarChar, Value = c.EstateName }, new SqlParameter { ParameterName = "@framework_Address", SqlDbType = SqlDbType.NVarChar, Value = c.Address }, new SqlParameter { ParameterName = "@statusId", SqlDbType = SqlDbType.Int, Value = p }, })); } catch (Exception ex) { throw ex; } }
static void Estate_A2C_ing(string estateId) { // DateTime begin = DateTime.Now; EstateCmService estateCmService = new EstateCmService(); EstateCmType estateCmType = estateCmService.GetEstateTypeById(estateId); EstateCtType estateCtType = new EstateCtType(estateCmType); EstateCtService estateCtService = new EstateCtService(); estateCtService.ImportEstate(estateCtType); BuildCmService buildCmService = new BuildCmService(); List <BuildCmType> buildType = buildCmService.ListBuild(estateId).ToList(); if (buildType != null && buildType.Count > 0) { buildType.ForEach(item => { Console.WriteLine("时间: {0}, 开始导入栋座[{1}]..", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), item.BuildName); Build_A2C(item); }); } DateTime end = DateTime.Now; }
public EstateCm(EstateCmType centaEstateType) : base(centaEstateType) { this.Scope = new Scope(this.ScopeId); }