Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                int gridSize = 0;
                if (!int.TryParse(ConfigurationManager.AppSettings["FindAnAgent.GridSize"], out gridSize))
                {
                    gridSize = 20;
                }
                ResultsGridView.PageSize = gridSize;

                OfficeActivityListBox.DataSource = ActivityHelper.GetActivities();
                OfficeActivityListBox.DataBind();

                OfficeActivityListBox.Items.Insert(0, new ListItem("(Any)", string.Empty));
                OfficeActivityListBox.SelectedIndex = 0;
            }
        }
        catch (Exception ex)
        {
            AutoMail.sendErrorMail(ex);
        }
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Hide Our Team unless the "showTeam=1" parameter provided in queryString
        if (Request.QueryString["showTeam"] == "1")
        {
            pnlOurTeam.Visible = true;
        }
        else
        {
            return;
        }

        try
        {
            if (!IsPostBack)
            {
                Agency = REIQ.Access.Agency.GetFromAgencyId(this.AgencyId);

                //Our team init
                if (Agency != null)
                {
                    rptAgent.DataSource = REIQ.Access.Agency.GetOfficeAgentsImisProfile(this.AgencyId);
                    rptAgent.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
            AutoMail.sendErrorMail(ex);
        }
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Agent = REIQ.Access.Agent.GetFromAgentId(this.AgentId);
            if (Agent != null)
            {
                Int32 featuredPropertyID = 0;
                //Getting featured propertyID
                if (Agent.featurepid != null)
                {
                    if (Agent.featurepid > 0)
                    {
                        featuredPropertyID = (int)Agent.featurepid;
                    }
                }
                //If no featured PropertyId defined - try get random PropertyID for this agent
                if (featuredPropertyID == 0)
                {
                    featuredPropertyID = REIQ.Access.Agent.GetRandomPropertyIdByAgent(AgentId);
                }

                if (featuredPropertyID > 0)
                {
                    Property = REIQ.Access.Property.GetFromPropertyId(featuredPropertyID);
                }
            }
        }
        catch (Exception ex)
        {
            AutoMail.sendErrorMail(ex);
        }
    }
Example #4
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);
        }
    }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Node CurrentPage = Node.GetCurrent();

            if (CurrentPage.GetProperty("showRefineSearch") == null)
            {
                return;
            }

            if (CurrentPage.GetProperty("showRefineSearch").Value != "1")
            {
                return;
            }
            else
            {
                phSearchRefineForm.Visible = true;
            }

            if (!IsPostBack)
            {
                InitControls();
            }
        }
        catch (Exception ex)
        {
            AutoMail.sendErrorMail(ex);
        }
    }
Example #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Suburb = REIQ.Access.Suburb.GetFromName(SuburbName);
     }
     catch (Exception ex)
     {
         AutoMail.sendErrorMail(ex);
     }
 }
Example #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Property = REIQ.Access.Property.GetFromPropertyId(this.PropertyId);
     }
     catch (Exception ex)
     {
         AutoMail.sendErrorMail(ex);
     }
 }
Example #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            CurrentPage = Node.GetCurrent();

            if (CurrentPage.GetProperty("showContactForm") == null)
            {
                return;
            }

            if (CurrentPage.GetProperty("showContactForm").Value != "1")
            {
                return;
            }
            else
            {
                ContactForm.Visible = true;

                if (CurrentPage.GetProperty("contactFormEmailAddress") != null && !String.IsNullOrEmpty(CurrentPage.GetProperty("contactFormEmailAddress").Value))
                {
                    Int32 emailAddressNodeID = Convert.ToInt32(CurrentPage.GetProperty("contactFormEmailAddress").Value);
                    if (emailAddressNodeID > 0)
                    {
                        Node emailAddressNode = new Node(emailAddressNodeID);

                        if (emailAddressNode != null)
                        {
                            if (emailAddressNode.GetProperty("emailAddress") != null && !String.IsNullOrEmpty(emailAddressNode.GetProperty("emailAddress").Value))
                            {
                                ToEmail = DataUtility.Encrypt(emailAddressNode.GetProperty("emailAddress").Value);
                            }
                            if (emailAddressNode.GetProperty("relatedThankYouPage") != null && !String.IsNullOrEmpty(emailAddressNode.GetProperty("relatedThankYouPage").Value))
                            {
                                Int32 relatedThankYouPageID = Convert.ToInt32(emailAddressNode.GetProperty("relatedThankYouPage").Value);
                                if (relatedThankYouPageID > 0)
                                {
                                    Node relatedThankYouPageNode = new Node(relatedThankYouPageID);
                                    if (relatedThankYouPageNode != null)
                                    {
                                        RelatedThankYouPage = relatedThankYouPageNode.Url;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            AutoMail.sendErrorMail(ex);
        }
    }
Example #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         TowerAdString = GetTowerAdvertisements();
     }
     catch (Exception ex)
     {
         AutoMail.sendErrorMail(ex);
     }
 }
Example #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!String.IsNullOrEmpty(Request.QueryString["pid"]))
         {
             Property = REIQ.Access.Property.GetFromPropertyId(this.PropertyId);
             address  = getAddress();
         }
     }
     catch (Exception ex)
     {
         AutoMail.sendErrorMail(ex);
     }
 }
Example #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Agency = REIQ.Access.Agency.GetFromAgencyId(this.AgencyId);
         if (Agency != null)
         {
             AgencyAddress = AgencyHelper.GetAgencyAddress(Agency);
         }
     }
     catch (Exception ex)
     {
         AutoMail.sendErrorMail(ex);
     }
 }
Example #12
0
 protected void SearchButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (Page.IsValid)
         {
             ResultsGridView.PageIndex = 0;
             GridBind();
         }
     }
     catch (Exception ex)
     {
         AutoMail.sendErrorMail(ex);
     }
 }
Example #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Agency = REIQ.Access.Agency.GetFromAgencyId(this.AgencyId);
         //Gmap  initialise
         if (Agency != null)
         {
             ClientScriptManager cs = Page.ClientScript;
             cs.RegisterStartupScript(GetType(), "onLoadCall", "<Script>load('" + AgencyHelper.GetAgencyAddress(Agency) + "')</Script>", false);
         }
     }
     catch (Exception ex)
     {
         AutoMail.sendErrorMail(ex);
     }
 }
Example #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Agent = REIQ.Access.Agent.GetFromAgentId(this.AgentId);
         if (Agent != null)
         {
             if (Agent.acID != null)
             {
                 Agency = REIQ.Access.Agency.GetFromAgencyId((int)Agent.acID);
             }
         }
     }
     catch (Exception ex)
     {
         AutoMail.sendErrorMail(ex);
     }
 }
Example #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Property = REIQ.Access.Property.GetFromPropertyId(this.PropertyId);

            if (Property != null)
            {
                DefaultAgent = REIQ.Access.Agent.GetFromPropertyId(Property.pID);
                Agency       = REIQ.Access.Agency.GetFromPropertyId(this.PropertyId);
                Region       = REIQ.Access.Property.GetPropertyRegion(Property.pID);

                CurrentPage = Node.GetCurrent();
                CurrentUrl  = DataUtility.Encrypt("http://" + Request.Url.Host + Request.RawUrl);

                if (CurrentPage.GetProperty("relatedThankYouPage") != null && !String.IsNullOrEmpty(CurrentPage.GetProperty("relatedThankYouPage").Value))
                {
                    Int32 relatedThankYouPageID = Convert.ToInt32(CurrentPage.GetProperty("relatedThankYouPage").Value);
                    if (relatedThankYouPageID > 0)
                    {
                        Node relatedThankYouPageNode = new Node(relatedThankYouPageID);
                        if (relatedThankYouPageNode != null)
                        {
                            RelatedThankYouPage = relatedThankYouPageNode.Url;
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            AutoMail.sendErrorMail(ex);
        }

        if (Property == null)
        {
            btnSend.Enabled = false;
        }
    }
Example #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Agency = REIQ.Access.Agency.GetFromAgencyId(this.AgencyId);

            if (Agency != null)
            {
                if (Agency.email != null && !String.IsNullOrEmpty(Agency.email))
                {
                    ToEmail = DataUtility.Encrypt(Agency.email);
                }
                if (Agency.name != null && !String.IsNullOrEmpty(Agency.name))
                {
                    AgencyName = Agency.name;
                }

                CurrentPage = Node.GetCurrent();

                if (CurrentPage.GetProperty("relatedThankYouPage") != null && !String.IsNullOrEmpty(CurrentPage.GetProperty("relatedThankYouPage").Value))
                {
                    Int32 relatedThankYouPageID = Convert.ToInt32(CurrentPage.GetProperty("relatedThankYouPage").Value);
                    if (relatedThankYouPageID > 0)
                    {
                        Node relatedThankYouPageNode = new Node(relatedThankYouPageID);
                        if (relatedThankYouPageNode != null)
                        {
                            RelatedThankYouPage = relatedThankYouPageNode.Url;
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            AutoMail.sendErrorMail(ex);
        }
    }
Example #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //Property = REIQ.Access.Property.GetFromPropertyId(this.PropertyId);
            Property = REIQ.Access.Property.GetAnyFromPropertyId(this.PropertyId);

            //Log page view
            if (Property != null && !IsPostBack)
            {
                LogHelper.EditPublicLog(Property.pID.ToString(), Property.acID.ToString());
                //cheking if property is hidden for some reason and make redirection in that case
                REIQ.Helpers.PropertyHelper.CheckIfHidden(Property);
            }
        }
        catch (System.Threading.ThreadAbortException)
        {
        }
        catch (Exception ex)
        {
            AutoMail.sendErrorMail(ex);
        }
    }
Example #18
0
        public void ProcessRequest(HttpContext context)
        {
            String txtName         = context.Request["txtName"];
            String txtPhone        = context.Request["txtPhone"];
            String txtEmail        = context.Request["txtEmail"];
            String txtComments     = context.Request["txtComments"];
            String txtCode         = context.Request["txtCode"];
            String toEmail         = ConfigurationManager.AppSettings["adminemail"];
            String currentPageName = context.Request["currentPageName"];
            String replyBy         = context.Request["replyBy"];
            String toKnow          = context.Request["toKnow"];
            int    propertyId      = Convert.ToInt32(context.Request["propertyId"]);
            String link            = DataUtility.Decrypt(context.Request["link"]);

            REIQ.Entities.Property Property = REIQ.Access.Property.GetFromPropertyId(propertyId);
            DefaultAgent = REIQ.Access.Agent.GetFromPropertyId(propertyId);
            Agency       = REIQ.Access.Agency.GetFromPropertyId(propertyId);
            Region       = REIQ.Access.Property.GetPropertyRegion(propertyId);

            String capthcaImageText = String.Empty;

            if (context.Session["CaptchaImageText"] != null)
            {
                capthcaImageText = context.Session["CaptchaImageText"].ToString();
            }

            context.Response.ContentType = "text/html";

            if (String.IsNullOrEmpty(txtCode) || txtCode != capthcaImageText)
            {
                context.Response.Write("captchaFail");
            }
            else
            {
                string agentNames = String.Empty;

                //Trying to get all associated agents emails
                if (Property.aID1 != null)
                {
                    Agent1 = REIQ.Access.Agent.GetFromAgentId((int)Property.aID1);
                    if (Agent1 != null)
                    {
                        toEmail    = Agent1.email;
                        agentNames = Agent1.firstname + " " + Agent1.surname;
                    }
                }

                if (Property.aID2 != null)
                {
                    Agent2 = REIQ.Access.Agent.GetFromAgentId((int)Property.aID2);
                    if (Agent2 != null)
                    {
                        if (!String.IsNullOrEmpty(Agent2.email))
                        {
                            toEmail += ", " + Agent2.email;
                        }
                        agentNames = ", " + Agent2.firstname + " " + Agent2.surname;
                    }
                }

                if (Property.aID3 != null)
                {
                    Agent3 = REIQ.Access.Agent.GetFromAgentId((int)Property.aID3);
                    if (Agent3 != null)
                    {
                        if (!String.IsNullOrEmpty(Agent3.email))
                        {
                            toEmail += ", " + Agent3.email;
                        }
                        agentNames = ", " + Agent3.firstname + " " + Agent3.surname;
                    }
                }

                //If no associated agents - then try get associated agency
                if (string.IsNullOrEmpty(toEmail))
                {
                    if (Agency != null)
                    {
                        toEmail = Agency.email;
                    }
                }

                //If still nothing associated - send error message.
                if (string.IsNullOrEmpty(toEmail))
                {
                    AutoMail.sendErrorMail(new Exception("No email found for propertyID:" + propertyId));
                }

                string strlink  = link;
                string strprice = PropertyHelper.GetPropertyPrice(Property);
                string address  = PropertyHelper.GetAddress(Property);

                string strBody = "";

                strBody = strBody + "To " + agentNames + "<br><br>";
                strBody = strBody + "<font style='color:#c0143c'>RE: WEB ENQUIRY FOR " + address + "</font><br><br>";
                strBody = strBody + "<b>Please find below an enquiry from reiq.com</b><br><br>";

                strBody = strBody + "<table width=650 border=0>";
                strBody = strBody + "<tr>";
                strBody = strBody + "<td width=250>From: </td>";
                strBody = strBody + "<td >" + txtName + "</td>";
                strBody = strBody + "</tr>";
                strBody = strBody + "<tr>";
                strBody = strBody + "<tr>";
                strBody = strBody + "<td>Email: </td>";
                strBody = strBody + "<td>" + txtEmail + "</td>";
                strBody = strBody + "</tr>";
                strBody = strBody + "<tr>";
                strBody = strBody + "<td>Phone: </td>";
                strBody = strBody + "<td>" + txtPhone + "</td>";
                strBody = strBody + "</tr>";
                strBody = strBody + "<tr>";
                strBody = strBody + "<td>Preferred Contact: </td>";
                strBody = strBody + "<td>" + replyBy + "</td>";
                strBody = strBody + "</tr>";
                strBody = strBody + "<tr>";
                strBody = strBody + "<td>Date of enquiry: </td>";
                strBody = strBody + "<td>" + DateTime.Now.ToLongDateString() + "</td>";
                strBody = strBody + "</tr>";
                strBody = strBody + "<tr>";
                strBody = strBody + "<td>Would like to request information on: </td>";
                strBody = strBody + "<td>" + toKnow + "</td>";
                strBody = strBody + "</tr>";
                strBody = strBody + "<tr>";
                strBody = strBody + "<td valign='top'>Comments: </td>";
                strBody = strBody + "<td >" + txtComments + "</td>";
                strBody = strBody + "</tr>";
                strBody = strBody + "</table>";

                strBody = strBody + "<br><br><font style='color:#c0143c'>PLEASE HIT 'REPLY' TO RESPOND DIRECTLY TO THIS ENQUIRY.</font><br><br>";

                strBody = strBody + "<table border='0' width='650'>";
                strBody = strBody + "<tr>";
                strBody = strBody + "<td valign='top'><a href='" + strlink + "'>" + PropertyHelper.GetSearchImageUrl(Property.pID.ToString(), Property.hasPhotoLarge, Property.type, address, Property.status, strprice, "106", "70") + "</a></td>";
                strBody = strBody + "<td width='10'></td>";
                strBody = strBody + "<td valign='top' align='left'>";
                strBody = strBody + "<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
                strBody = strBody + "<tr>";
                strBody = strBody + "<td colspan='2' align='left' class='txtAddress' height='25' valign='top'>" + address.ToUpper() + "&nbsp;<span class='newly'>" + Property.type + "</span>  &nbsp;" + PropertyHelper.GetFurnished(Property.isFurnished) + "" + PropertyHelper.GetNewlyAdded(Property.dateListed == null ? DateTime.MinValue : (DateTime)Property.dateListed) + "" + getstatus(Property.status) + "</span></td>";
                strBody = strBody + "</tr>";
                strBody = strBody + "<tr height='20'><td colspan='2' style='color:#595a5f;' valign='top'><b>" + Property.descriptionShort + "</b></td></tr>";
                strBody = strBody + "<tr>";
                strBody = strBody + "<td colspan='2' align='left'>";
                strBody = strBody + PropertyHelper.GetShortDescription(Property.descriptionLong, 120) + "...<br />   ";
                strBody = strBody + PropertyHelper.GetAuctionFormat(Property.auctionDate == null ? String.Empty : Property.auctionDate.ToString(), Property.auctionTime);
                strBody = strBody + "</td>";
                strBody = strBody + "</tr>";
                strBody = strBody + checkHomeOpen(PropertyHelper.GetHomeOpensFormat_New(Property.homeopen1From.ToString(), Property.homeopen1To.ToString(), Property.homeopen2From.ToString(), Property.homeopen2To.ToString()));
                strBody = strBody + "<tr height='20'><td  colspan='2'><b><span class='txtPink14'>" + strprice + "</span> | <span class='txtPink'>Property Type: " + Property.type + "</span></b></td></tr>";
                strBody = strBody + "</table>";
                strBody = strBody + "<a href='" + strlink + "' ><img name='btn_view_more2' src='images/btn_view_more.jpg' onMouseOver='this.src='images/btn_view_more_f2.jpg''  onMouseOut='this.src='images/btn_view_more.jpg''/></a>";
                strBody = strBody + "</td>";
                strBody = strBody + "<td valign='top' width='200' align='right'>";
                strBody = strBody + PropertyHelper.GetDisplaySearchFeaturesSmall(Property.numBedrooms.ToString(), Property.numBathrooms.ToString(), Property.numCarbays.ToString(), Property.numStudy.ToString(), Property.hasPool.ToString(), Property.numGarage.ToString());
                strBody = strBody + "<br />";
                if (Agency != null)
                {
                    strBody = strBody + Images.GetAgencyImage(Agency.acID, 196, 88);
                    strBody = strBody + "<br /><br />";
                }
                if (DefaultAgent != null)
                {
                    strBody = strBody + PropertyHelper.GetAgentData(DefaultAgent, Property.pID);
                }
                strBody = strBody + "</td>";
                strBody = strBody + "</tr>";
                strBody = strBody + "</table>";

                strBody = PropertyHelper.GetEmailbox(strBody);

                string sub = "";
                if (address != null)
                {
                    sub = "Web Enquiry for " + address.Replace("<b>", "").Replace("</b>", "") + "  from REIQ";
                }
                else
                {
                    sub = "Web Enquiry for from REIQ";
                }

                try
                {
                    AutoMail.Mail_Send(txtEmail, toEmail, sub, strBody);

                    LogHelper.InsertLog(Property.pID.ToString(), Property.acID.ToString(), Property.aID1.ToString(), Property.suburb, txtEmail, txtPhone);

                    context.Response.Write("true");
                }
                catch (Exception ex)
                {
                    AutoMail.sendErrorMail(ex);
                    context.Response.Write(ex.Message);
                }
            }
        }
Example #19
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);
        }
    }
Example #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!String.IsNullOrEmpty(Request.QueryString["pid"]))
            {
                Property = REIQ.Access.Property.GetFromPropertyId(this.PropertyId);

                if (Property != null)
                {
                    string gaddress = PropertyHelper.GetGoogleAddress(null, Property.unitNum, Property.rdNum, Property.rdName, Property.rdType, Property.suburb, Property.hideRoadName, Property.hideRoadNum) + "," + Property.state + " " + Property.postcode;;

                    daddress = gaddress.Replace(" ", "+");
                    daddress = daddress.Replace(",", "+");
                    if (gaddress.Contains("'"))
                    {
                        daddress = Property.suburb + "," + Property.state + " " + Property.postcode;
                    }
                    else
                    {
                        daddress = gaddress;
                    }

                    strLoadMap = strLoadMap + Environment.NewLine + "function load(){";

                    strLoadMap = strLoadMap + Environment.NewLine + "var mapOptions = {";
                    strLoadMap = strLoadMap + Environment.NewLine + "zoom: 13,";
                    strLoadMap = strLoadMap + Environment.NewLine + "overviewMapControl: true,";
                    strLoadMap = strLoadMap + Environment.NewLine + "overviewMapControlOptions:{opened:true},";
                    strLoadMap = strLoadMap + Environment.NewLine + "mapTypeId: google.maps.MapTypeId.ROADMAP,";
                    strLoadMap = strLoadMap + Environment.NewLine + "scaleControl: true";
                    strLoadMap = strLoadMap + Environment.NewLine + "};";

                    strLoadMap = strLoadMap + Environment.NewLine + "map = new google.maps.Map(document.getElementById('map'), mapOptions);";
                    //strLoadMap = strLoadMap + Environment.NewLine + "map.setCenter(new google.maps.LatLng(-19.7061, 145.774002), 13);";
                    strLoadMap = strLoadMap + Environment.NewLine + "geocoder = new google.maps.Geocoder();";
                    strLoadMap = strLoadMap + Environment.NewLine + "var strTable = ''";
                    if (gaddress.Contains("'"))
                    {
                        strLoadMap = strLoadMap + Environment.NewLine + "strTable = '<table border=0 celllpadding=0 cellspacing=0><tr><td valign=top>" + Property.suburb + "," + Property.state + " " + Property.postcode + "</td></tr>';";
                    }
                    else
                    {
                        strLoadMap = strLoadMap + Environment.NewLine + "strTable = '<table border=0 celllpadding=0 cellspacing=0><tr><td valign=top>" + gaddress + "</td></tr>';";
                    }
                    //strLoadMap = strLoadMap + Environment.NewLine + "strTable = strTable + '<tr><td>Directions <a href=javascript:myShow1();javascript:myHide1();>To here</a>  | <a href=javascript:myShow2();javascript:myHide2();>From here</a></td></tr></table>';";
                    //strLoadMap = strLoadMap + Environment.NewLine + "strTable = strTable + '<table border=0 celllpadding=0 cellspacing=0 height=50><tr><td height=5></td></tr><tr><td valign=top id=tohere STYLE=display:none;>Enter your start point<br><input name=txtfrom id=txtfrom type=text ><input type=button onclick=javascript:openFrom() name=btnGo1 value=Go></td></tr>';";
                    //strLoadMap = strLoadMap + Environment.NewLine + "strTable = strTable + '<tr><td id=fromhere STYLE=display:none;>End address<br><input name=txtto id=txtto type=text ><input type=button onclick=javascript:openTo() name=btnGo2 value=Go></td></tr>';";
                    strLoadMap = strLoadMap + Environment.NewLine + "strTable = strTable + '</table>';";
                    if (gaddress.Contains("'"))
                    {
                        strLoadMap = strLoadMap + Environment.NewLine + "showAddress('" + Property.suburb + "," + Property.state + " " + Property.postcode + "', strTable);";
                    }
                    else
                    {
                        strLoadMap = strLoadMap + Environment.NewLine + "showAddress('" + gaddress + "', strTable);";
                    }
                    strLoadMap = strLoadMap + Environment.NewLine + "}";
                }
            }
            if (!String.IsNullOrEmpty(Request.QueryString["add"]))
            {
                daddress = ConfigurationManager.AppSettings["companyaddress"];
                daddress = daddress.Replace(",", "+");

                strLoadMap = strLoadMap + Environment.NewLine + "function load(){";

                strLoadMap = strLoadMap + Environment.NewLine + "var mapOptions = {";
                strLoadMap = strLoadMap + Environment.NewLine + "zoom: 13,";
                strLoadMap = strLoadMap + Environment.NewLine + "overviewMapControl: true,";
                strLoadMap = strLoadMap + Environment.NewLine + "overviewMapControlOptions:{opened:true},";
                strLoadMap = strLoadMap + Environment.NewLine + "mapTypeId: google.maps.MapTypeId.ROADMAP,";
                strLoadMap = strLoadMap + Environment.NewLine + "scaleControl: true";
                strLoadMap = strLoadMap + Environment.NewLine + "};";

                strLoadMap = strLoadMap + Environment.NewLine + "map = new google.maps.Map(document.getElementById('map'), mapOptions);";
                //strLoadMap = strLoadMap + Environment.NewLine + "map.setCenter(new google.maps.LatLng(-19.7061,145.774002), 13);";
                strLoadMap = strLoadMap + Environment.NewLine + "geocoder = new google.maps.Geocoder();";
                strLoadMap = strLoadMap + Environment.NewLine + "var strTable = ''";
                strLoadMap = strLoadMap + Environment.NewLine + "strTable = '<table border=0 celllpadding=0 cellspacing=0><tr><td valign=top>" + ConfigurationManager.AppSettings["companyaddress"] + "</td></tr>';";
                //strLoadMap = strLoadMap + Environment.NewLine + "strTable = strTable + '<tr><td>Directions <a href=javascript:myShow1();javascript:myHide1();>To here</a>  | <a href=javascript:myShow2();javascript:myHide2();>From here</a></td></tr></table>';";
                //strLoadMap = strLoadMap + Environment.NewLine + "strTable = strTable + '<table border=0 celllpadding=0 cellspacing=0 height=50><tr><td height=5></td></tr><tr><td valign=top id=tohere STYLE=display:none;>Enter your start point<br><input name=txtfrom id=txtfrom type=text ><input type=button onclick=javascript:openFrom() name=btnGo1 value=Go></td></tr>';";
                //strLoadMap = strLoadMap + Environment.NewLine + "strTable = strTable + '<tr><td id=fromhere STYLE=display:none;>End address<br><input name=txtto id=txtto type=text ><input type=button onclick=javascript:openTo() name=btnGo2 value=Go></td></tr>';";
                strLoadMap = strLoadMap + Environment.NewLine + "strTable = strTable + '</table>';";
                strLoadMap = strLoadMap + Environment.NewLine + "showAddress('" + ConfigurationManager.AppSettings["companyaddress"] + "', strTable);";
                strLoadMap = strLoadMap + Environment.NewLine + "}";
            }
        }
        catch (Exception ex)
        {
            AutoMail.sendErrorMail(ex);
        }
    }
Example #21
0
        public void ProcessRequest(HttpContext context)
        {
            String txtName         = context.Request["txtName"];
            String txtPhone        = context.Request["txtPhone"];
            String txtEmail        = context.Request["txtEmail"];
            String txtComments     = context.Request["txtComments"];
            String txtCode         = context.Request["txtCode"];
            String toEmail         = (!String.IsNullOrEmpty(context.Request["sendToEmail"]) ? DataUtility.Decrypt(context.Request["sendToEmail"]) : ConfigurationManager.AppSettings["adminemail"]);
            String currentPageName = context.Request["currentPageName"];

            String capthcaImageText = String.Empty;

            if (context.Session["CaptchaImageText"] != null)
            {
                capthcaImageText = context.Session["CaptchaImageText"].ToString();
            }

            context.Response.ContentType = "text/html";

            if (String.IsNullOrEmpty(txtCode) || txtCode != capthcaImageText)
            {
                context.Response.Write("captchaFail");
            }
            else
            {
                try
                {
                    string strBody = "";

                    //strBody = strBody + "<br>To " + agencyName + "<br><br>";
                    strBody = strBody + "<font style='color:#c0143c'>The form on " + currentPageName + " was submitted</font><br><br>";
                    strBody = strBody + "<b>Please find below an enquiry from reiq.com</b><br><br>";

                    strBody = strBody + "<table width=600 border=0>";
                    strBody = strBody + "<tr>";
                    strBody = strBody + "<td width=150>From: </td>";
                    strBody = strBody + "<td width=450>" + txtName + "</td>";
                    strBody = strBody + "</tr>";
                    strBody = strBody + "<tr>";
                    strBody = strBody + "<tr>";
                    strBody = strBody + "<td>Email: </td>";
                    strBody = strBody + "<td>" + txtEmail + "</td>";
                    strBody = strBody + "</tr>";
                    strBody = strBody + "<tr>";
                    strBody = strBody + "<td>Phone: </td>";
                    strBody = strBody + "<td>" + txtPhone + "</td>";
                    strBody = strBody + "</tr>";
                    strBody = strBody + "<tr>";
                    strBody = strBody + "<td>Date of enquiry: </td>";
                    strBody = strBody + "<td>" + DateTime.Now.ToLongDateString() + "</td>";
                    strBody = strBody + "</tr>";
                    strBody = strBody + "<tr>";
                    strBody = strBody + "<td valign='top'>Message: </td>";
                    strBody = strBody + "<td >" + txtComments + "</td>";
                    strBody = strBody + "</tr>";
                    strBody = strBody + "</table>";

                    strBody = strBody + "<br><br><font style='color:#c0143c'>PLEASE HIT 'REPLY' TO RESPOND DIRECTLY TO THIS ENQUIRY.</font><br><br>";

                    strBody = AgencyHelper.GetEmailBox(strBody);

                    AutoMail.Mail_Send(txtEmail, toEmail, "Web Enquiry from REIQ", strBody);
                    context.Response.Write("true");
                }
                catch (Exception ex)
                {
                    AutoMail.sendErrorMail(ex);
                    context.Response.Write(ex.Message);
                }
            }
        }