TechEthical CEHP
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Directory;
using System.Data;
using Microsoft.SqlServer;
using System.Data.SqlClient;
namespace Bathuasoft
{
public partial class Contact_Us : System.Web.UI.Page
{
public DataTable dtConatactUs = new DataTable();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
connection_sql obj = new connection_sql();
obj.MakeConnection();
dtConatactUs = obj.getDataTable("Select * from contact_details");
}
protected void butSubmit_Click(object sender, EventArgs e)
{
txtRemark.Text = txtRemark.Text.ToLower();
int http = txtRemark.Text.ToLower().IndexOf("http");
if (txtPhone.Text.Trim().Length != 10)
{
ScriptManager.RegisterStartupScript(this, GetType(), "set", "alert('Invalid Mobile Number');", true);
}
else if (txtName.Text.Trim().Length < 2)
{
ScriptManager.RegisterStartupScript(this, GetType(), "set", "alert('Invalid or blank Name');", true);
}
else if (http > 0 || txtRemark.Text.ToLower().IndexOf("www") > 0 || txtRemark.Text.ToLower().IndexOf(" sex") > 0 || txtRemark.Text.ToLower().IndexOf("dating") > 0 || txtRemark.Text.ToLower().IndexOf("adults") > 0 || txtRemark.Text.ToLower().IndexOf("fuck") > 0 || txtRemark.Text.ToLower().IndexOf("chut") > 0 || txtRemark.Text.ToLower().IndexOf("choot") > 0)
{
ScriptManager.RegisterStartupScript(this, GetType(), "set", "alert('Invalid your Message, Please ignore illegal words according to education.');", true);
}
else
{
connection_sql obj = new connection_sql();
obj.MakeConnection();
int n = 0;
SqlCommand cmd = new SqlCommand("[sp_SaveQryForm]", obj.conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Name", txtName.Text.Trim());
cmd.Parameters.AddWithValue("@EmailID", txtEmail.Text.Trim());
cmd.Parameters.AddWithValue("@PhoneNumber", txtPhone.Text.Trim());
cmd.Parameters.AddWithValue("@City", "");
cmd.Parameters.AddWithValue("@Qry", txtRemark.Text.Trim());
cmd.Parameters.AddWithValue("@Course", txtSubject.Text);
n = cmd.ExecuteNonQuery();
obj.CloseConnection();
// Send sms to your mobile
string msg = "Contact to N-" + txtName.Text.ToString() + ", M- " + txtPhone.Text
+ ", C- " + txtSubject.Text;
DataTable dtMob = new DataTable();
dtMob = obj.getDataTable("Select MobileNo1, MobileNo2 from contact_details");
sendsms objSMS = new sendsms();
objSMS.SendSMS_OTP(dtMob.Rows[0]["MobileNo1"].ToString(), msg);
objSMS.SendSMS_OTP(dtMob.Rows[0]["MobileNo2"].ToString(), msg);
if (n == 1)
{
ScriptManager.RegisterStartupScript(this, GetType(), "set", "alert('Your enquiry save successfully. Our support team contact to you shortly');", true);
}
txtName.Text = "";
txtPhone.Text = "";
txtRemark.Text = "";
txtEmail.Text = "";
txtSubject.Text = "";
}
}
}
}
TechEthical Mini WebShell Version 1.0, Coded By The_M@T3