using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using DataOper;
using EmailCode;

public partial class index1 : System.Web.UI.Page
{
    DataOperation dOper = new DataOperation();
    email mail = new email();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        lblMsg.Text = "";

        if (txtName.Text.Trim() == "")
        {
            lblMsg.Text = "Name field can not be blank.";
            txtName.Focus();
            return;
        }
        if (txtEmail.Text.Trim() == "")
        {
            lblMsg.Text = "Email field can not be blank.";
            txtEmail.Focus();
            return;
        }
        if (txtMessage.Text.Trim() == "")
        {
            lblMsg.Text = "Message field can not be blank.";
            txtMessage.Focus();
            return;
        }

        dOper.sqlExec("insert into tbl_footer_quick_enquery(name,email,message,action_on) values ('" + txtName.Text.Replace("'", "`").Trim() + "','" + txtEmail.Text.Replace("'", "`").Trim() + "','" + txtMessage.Text.Replace("'", "`").Trim() + "','" + System.DateTime.Now.ToString("dd-MMM-yyyy HH:mm:ss") + "')");
        mail.FooterReachUsFormMailSend(txtName.Text, txtEmail.Text, txtMessage.Text);
        lblMsg.Text = "Submitted successfully!";
        txtName.Text = "";
        txtEmail.Text = "";
        txtMessage.Text = "";

    }
}