Esempio n. 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;
            }
        }
        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;
            }
        }
Esempio n. 3
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);
        }