Example #1
0
        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;
            }
        }
Example #2
0
        static void CompareOrder()
        {
            Console.WriteLine("时间: [{0}],比较程序开始..", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
            EstateCmService service = new EstateCmService();

            try
            {
                var order = service.ListOrder(AppSettings.Banch, OrderStatus.FRAMEWORKED);
                if (order != null && order.Count > 0)
                {
                    order.ForEach(m =>
                    {
                        CompareEstate(m.EstateId);
                        service.UpdateOrderStatus(m.EstateId, OrderStatus.COMPARED);
                    });
                }
                else
                {
                    Console.WriteLine("时间: [{0}],没有需要比较的楼盘..", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
 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;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string httpMethod = Request.HttpMethod;
                string estateId   = ConvertUtility.Trim(Request.QueryString["id"]);

                if (httpMethod.Equals("get", StringComparison.OrdinalIgnoreCase))
                {
                    EstateCmService estateService = new EstateCmService();
                    this.Estate = estateService.GetEstateById(estateId);
                }
                else
                {
                    //AddData
                    string buildName = ConvertUtility.Trim(Request.Form["buildName"]);

                    BuildCtService buildService = new BuildCtService();

                    if (buildService.AddBuild(estateId, buildName, this.UserInfo.UserId))
                    {
                        Response.Write("true");
                    }
                    else
                    {
                        Response.Write("false");
                    }
                    Response.End();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #5
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 static bool Save(string id)
 {
     try
     {
         string[]        estateId      = id.Split(new string[] { AppSettings.FirstSplit }, StringSplitOptions.RemoveEmptyEntries);
         EstateCmService estateService = new EstateCmService();
         MemberService   memberService = new MemberService();
         string          createBy      = memberService.GetUserInfo().UserId;
         return(estateService.SaveOrder(estateId, createBy));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #7
0
 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"]);
         this.PageSize         = AppSettings.PageSize;
         this.EstateCollection = estateService.GetEstateByType(type, code, pageIndex, this.PageSize, out recordCount);
         this.RecordCount      = recordCount;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        /// <summary>
        /// AgencyComDb to CollectDb
        /// </summary>
        static void A2C()
        {
            DateTime        begin   = DateTime.Now;
            EstateCmService service = new EstateCmService();

            Console.WriteLine("时间: {0}, 从Order中获取重点楼盘..", begin.ToString("yyyy-MM-dd hh:mm:ss"));
            List <OrderType> order = service.ListOrder(AppSettings.Banch, OrderStatus.REQUEST);

            Console.WriteLine("时间: {0}, 重点楼盘{1}个..", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), order.Count);
            if (order != null && order.Count > 0)
            {
                order.ForEach(item =>
                {
                    Console.WriteLine("时间: {0}, 开始导入楼盘[{1}]..", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), item.EstateId);
                    Estate_A2C_ing(item.EstateId);
                });
                DateTime end = DateTime.Now;
                Console.WriteLine("时间: {0}, 结束导入,总共用时: {1}", end.ToString("yyyy-MM-dd hh:mm:dd"), (end - begin).ToString());
            }
        }
Example #9
0
        private string GetTitleBar(string type, string code)
        {
            string titleBar   = string.Empty;
            string searchMenu = string.Empty;

            switch (type)
            {
            case Architectures.CITY:
            {
                City city = new City(code);
                titleBar = city.ToNavBar(false);
                break;
            }

            case Architectures.REGION:
            {
                Region region = new Region(code);
                titleBar = region.ToNavBar(false);
                break;
            }

            case Architectures.SCOPE:
            {
                Scope scope = new Scope(code);
                titleBar = scope.ToNavBar(false);
                break;
            }

            case Architectures.BIGESTATE:
            {
                EstateCmService estateService = new EstateCmService();
                EstateCm        estate        = estateService.GetEstateById(code);
                titleBar = estate.ToNavBar(false);
                break;
            }

            default:
                break;
            }
            return(titleBar);
        }
        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;
        }
        static void OrderStatusMonitor()
        {
            EstateCmService     estateCmService  = new EstateCmService();
            EstateCtService     estateCtService  = new EstateCtService();
            List <EstateCtType> ctTypeCollection = estateCtService.ListOrderStatus();

            if (ctTypeCollection != null && ctTypeCollection.Count > 0)
            {
                ctTypeCollection.ForEach(item =>
                {
                    switch (item.Flow)
                    {
                    case FlowStatus.COLLECTING:
                        {
                            Console.WriteLine("更新Order状态为[收集中--EstateId={0}]", item.AgencyCom_EstateId);
                            estateCmService.UpdateOrderStatus(item.AgencyCom_EstateId, OrderStatus.COLLECTING);
                            estateCtService.UpdateFlowStatus(item.EstateId, FlowStatus.COLLECTING_ORDERSTATUS);
                            break;
                        }

                    case FlowStatus.COLLECTED:
                        {
                            Console.WriteLine("更新Order状态[收集完成--EstateId={0}]", item.AgencyCom_EstateId);
                            estateCmService.UpdateOrderStatus(item.AgencyCom_EstateId, OrderStatus.COLLECTED);
                            estateCtService.UpdateFlowStatus(item.EstateId, FlowStatus.COLLECTED_ORDERSTATUS);
                            break;
                        }

                    default:
                        {
                            break;
                        }
                    }
                });
            }
            EstateFwService     estateFwService  = new EstateFwService();
            List <EstateFwType> fwTypeCollection = estateFwService.ListOrderStatus();

            if (fwTypeCollection != null && fwTypeCollection.Count > 0)
            {
                fwTypeCollection.ForEach(item =>
                {
                    switch (item.Flow)
                    {
                    case FlowStatus.COLLECTING:
                        {
                            Console.WriteLine("更新Order状态[录入中--EstateId={0}]", item.AgencyCom_EstateId);
                            estateCmService.UpdateOrderStatus(item.AgencyCom_EstateId, OrderStatus.FRAMEWORKING);
                            estateFwService.UpdateFlowStatus(item.EstateId, FlowStatus.COLLECTING_ORDERSTATUS);
                            break;
                        }

                    case FlowStatus.COLLECTED:
                        {
                            Console.WriteLine("更新Order状态[录入完成--EstateId={0}]", item.AgencyCom_EstateId);
                            estateCmService.UpdateOrderStatus(item.AgencyCom_EstateId, OrderStatus.FRAMEWORKED);
                            estateFwService.UpdateFlowStatus(item.EstateId, FlowStatus.COLLECTED_ORDERSTATUS);
                            break;
                        }

                    case FlowStatus.EXPORTED:
                        {
                            Console.WriteLine("更新Order状态[比较完成--EstateId={0}]", item.AgencyCom_EstateId);
                            estateCmService.UpdateOrderStatus(item.AgencyCom_EstateId, OrderStatus.COMPARED);
                            estateFwService.UpdateFlowStatus(item.EstateId, FlowStatus.EXPORTED_ORDERSTATUS);
                            break;
                        }

                    default:
                        {
                            break;
                        }
                    }
                });
            }
        }