Beispiel #1
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);
     }
 }
Beispiel #2
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);
     }
 }
Beispiel #3
0
    public static string GetAgentPhoneWithLog(Agent agent)
    {
        String html = String.Empty;

        if (agent != null)
        {
            String number = String.Empty;

            String phonetemp  = String.IsNullOrEmpty(agent.phone) ? String.Empty : agent.phone.Replace("(", "").Replace(")", "").Replace(" ", "").Trim();
            String mobiletemp = String.IsNullOrEmpty(agent.mobile) ? String.Empty : agent.mobile.Replace("(", "").Replace(")", "").Replace(" ", "").Trim();

            //If phones are different -> show them in priority(1-mobile, 2-phone)
            if (phonetemp != mobiletemp)
            {
                bool isHideMobile = false;

                if (agent.hidemobile != null)
                {
                    Boolean.TryParse(agent.hidemobile.ToString(), out isHideMobile);
                }

                if (!String.IsNullOrEmpty(agent.mobile) && !isHideMobile)
                {
                    number = AgencyHelper.GetAgentMobileFormat(agent.mobile);
                }
                else if (!String.IsNullOrEmpty(agent.phone))
                {
                    number = agent.phone;
                }
            }//If phones are the same - consider them both as office phone
            else if (!String.IsNullOrEmpty(agent.phone))
            {
                number = agent.phone;
            }

            html = GetClickToCallBasicHtml(agent, number);
        }

        return(HttpUtility.HtmlDecode(html));
    }
        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);
                }
            }
        }