예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Property = REIQ.Access.Property.GetFromPropertyId(this.PropertyId);

            if (Property != null)
            {
                Suburb = REIQ.Access.Suburb.GetFromName(Property.suburb);

                if (!IsPostBack)
                {
                    //Suburb Chart stuff
                    ch = new ChartClass();
                    ch.intChartRange = Convert.ToInt32("4");

                    cboChartType.SelectedValue = ChartType.ToString();

                    if (Suburb != null)
                    {
                        DataTable dtsuburbChart = ch.GetSubrub("any", Suburb.name, Suburb.postcode == null ? "0" : Suburb.postcode.ToString());

                        if (dtsuburbChart.Rows.Count > 0)
                        {
                            chartwork(int.Parse(dtsuburbChart.Rows[0]["suburbid"].ToString()), dtsuburbChart.Rows[0]["suburbname"].ToString());
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            AutoMail.sendErrorMail(ex);
        }
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Suburb = REIQ.Access.Suburb.GetFromName(SuburbName);

            if (!IsPostBack)
            {
                //Binding Suburbs
                //DataTable dtsuburb = ch.GetAllSubrubWithdesc("1000");

                //ahc.connection.Close();

                //for (int i = 0; i < dtsuburb.Rows.Count; i++)
                //{
                //    cboSuburbInfo.Items.Add(new ListItem(dtsuburb.Rows[i]["name"].ToString() + ", " + dtsuburb.Rows[i]["postcode"].ToString(), dtsuburb.Rows[i]["sid"].ToString()));
                //}

                //cboSuburbInfo.DataSource = REIQ.Access.Suburb.GetAllSuburbsByTop(1000);

                //cboSuburbInfo.Items.Insert(0, new ListItem("-Select Suburb-", ""));
                //cboSuburbInfo.DataBind();


                //Bedrooms setup
                cboSuburbInfo.Items.Add(new ListItem("Select Suburb", ""));
                foreach (REIQ.Entities.Suburb suburb in REIQ.Access.Suburb.GetAllSuburbsByTop(2000))
                {
                    cboSuburbInfo.Items.Add(new ListItem(suburb.name, suburb.name));
                }
                cboSuburbInfo.DataBind();

                cboSuburbInfo.SelectedValue = SuburbName;


                //if (!String.IsNullOrEmpty(Request.QueryString["su"]) && Request.QueryString["postcode"] != null)
                //{
                //    strSearchSuburb = Request.QueryString["su"].ToString();
                //    strSearchPostcode = Request.QueryString["postcode"].ToString();
                //}
                //else
                //{
                //    //cboSuburbInfo.SelectedIndex = 1;

                //    //DataRow[] drsuburb = dtsuburb.Select("sid=" + cboSuburbInfo.SelectedValue);

                //    //strSearchSuburb = drsuburb[0]["name"].ToString();
                //    //strSearchPostcode = drsuburb[0]["postcode"].ToString();
                //}

                //Suburb Chart stuff
                ch = new ChartClass();
                ch.intChartRange = Convert.ToInt32("4");

                cboChartType.SelectedValue = ChartType.ToString();

                if (Suburb != null)
                {
                    DataTable dtsuburbChart = ch.GetSubrub("any", Suburb.name, Suburb.postcode == null ? "0" : Suburb.postcode.ToString());

                    if (dtsuburbChart.Rows.Count > 0)
                    {
                        chartwork(int.Parse(dtsuburbChart.Rows[0]["suburbid"].ToString()), dtsuburbChart.Rows[0]["suburbname"].ToString());
                    }
                }
            }
        }
        catch (Exception ex)
        {
            AutoMail.sendErrorMail(ex);
        }
    }