Beispiel #1
0
        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 bool ImportEstate(EstateFwType estateFwType)
        {
            string funMsg = "function: ImportEstate(EstateCtType estateType)" + FileUtility.NewLine + _ClassMsg;

            try
            {
                estateFwType.CreateBy = "System.Console";
                int effected = _DbService.ImportEstate(estateFwType);
                return(effected > 0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public EstateFw GetEstateById(string estateId)
        {
            string funMsg = "Function: GetEstateById(string estateId)" + FileUtility.NewLine + _ClassMsg;

            try
            {
                EstateFwType centaEstateType = GetEstateTypeById(estateId);
                if (centaEstateType == null)
                {
                    return(null);
                }
                return(new EstateFw(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_C2F_Ing(string estateId)
        {
            //
            DateTime        begin           = DateTime.Now;
            EstateCtService estateCtService = new EstateCtService();
            EstateCtType    estateCtType    = estateCtService.GetEstateTypeById(estateId);
            EstateFwType    estateFwType    = new EstateFwType(estateCtType);
            EstateFwService estateFwService = new EstateFwService();

            estateFwService.ImportEstate(estateFwType);
            BuildCtService     buildCtService = new BuildCtService();
            List <BuildCtType> buildType      = buildCtService.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_C2F(item);
                });
            }
            DateTime end = DateTime.Now;
        }
 public EstateFw(EstateFwType estateType)
     : base(estateType)
 {
     this.Scope = new Scope(this.ScopeId);
 }