TechEthical CEHP
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.SqlServer;
using System.Data.SqlClient;
using System.Data;
using Directory;
namespace Bathuasoft
{
public partial class Default : System.Web.UI.Page
{
public List<string> strNews = new List<string>();
public List<string> ListTopperStudentsImage = new List<string>();
public DataTable dtSampleVedio = new DataTable();
public DataTable dtNews = new DataTable();
public DataTable dtImpBtn = new DataTable();
string ImagePath = @"\Img\WeSupport\";
public List<string> ListGalleryImage = new List<string>();
public DataTable dtConatactUs = new DataTable();
protected void Page_Load(object sender, EventArgs e)
{
connection_sql obj = new connection_sql();
obj.MakeConnection();
dtConatactUs = obj.getDataTable("Select * from contact_details");
if (!IsPostBack)
{
DataSet ds = new DataSet();
dtImpBtn = obj.getDataTable("Select * from tbl_ImportantButtons where status= 'Active' order by OrderNo ");
dtNews = obj.getDataTable("Select * from tbl_NewsEvent where Status='Active' Order by id desc");
dtSampleVedio = obj.getDataTable("Select Link from tbl_DemoLectures order by id desc");
ds = obj.getDataSet("select ShortContents,Heading,SubHeading from tbl_MainMenu order by ID");
lblInstituteContents.Text = ds.Tables[0].Rows[0]["ShortContents"].ToString();
lblInstitute.Text = ds.Tables[0].Rows[0]["Heading"].ToString();
lblSubHeading.Text = ds.Tables[0].Rows[0]["SubHeading"].ToString();
lblDemoLectures.Text = ds.Tables[0].Rows[1]["ShortContents"].ToString();
lblHeading1.Text = ds.Tables[0].Rows[1]["Heading"].ToString();
lblSubHeading2.Text = ds.Tables[0].Rows[1]["SubHeading"].ToString();
lblFacilities.Text = ds.Tables[0].Rows[2]["ShortContents"].ToString();
lblfacilitiesHeading.Text = ds.Tables[0].Rows[2]["Heading"].ToString();
lblStudentOfTheYear.Text = ds.Tables[0].Rows[3]["ShortContents"].ToString();
lblStudentOfTheYearHeading.Text = ds.Tables[0].Rows[3]["Heading"].ToString();
//lblWayOfTeaching.Text = ds.Tables[0].Rows[4]["ShortContents"].ToString();
//lblWayOfTeachingHeading.Text = ds.Tables[0].Rows[4]["Heading"].ToString();
lblTopNews.Text = ds.Tables[0].Rows[5]["ShortContents"].ToString();
//lblTopNewsHeading.Text = ds.Tables[0].Rows[5]["Heading"].ToString();
ds = obj.getDataSet("select ShortContents from tbl_SubMenu where onindex >= 1 order by onindex asc");
lblWhyChooseUs.Text = ds.Tables[0].Rows[0]["ShortContents"].ToString();
lblOurVision.Text = ds.Tables[0].Rows[1]["ShortContents"].ToString();
lblDirecterCorner.Text = ds.Tables[0].Rows[2]["ShortContents"].ToString();
lblEstablishment.Text = ds.Tables[0].Rows[3]["ShortContents"].ToString();
lblSuccessfulStudents.Text = ds.Tables[0].Rows[4]["ShortContents"].ToString();
lblCourseList.Text = ds.Tables[0].Rows[5]["ShortContents"].ToString();
lblStudyMaterial.Text = ds.Tables[0].Rows[6]["ShortContents"].ToString();
lblMockTest.Text = ds.Tables[0].Rows[7]["ShortContents"].ToString();
lblAmenities.Text = ds.Tables[0].Rows[8]["ShortContents"].ToString();
lblJobPlacement.Text = ds.Tables[0].Rows[9]["ShortContents"].ToString();
lblComputerLab.Text = ds.Tables[0].Rows[10]["ShortContents"].ToString();
lblScholarship.Text = ds.Tables[0].Rows[11]["ShortContents"].ToString();
//auto fill Courses
ds = obj.getDataSet("select name from tbl_Courses order by Name");
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
cmbCourse.Items.Clear();
cmbCourse.Items.Add("-Select Courses / Subject-");
for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
cmbCourse.Items.Add(ds.Tables[0].Rows[i]["Name"].ToString());
}
//Topper Image List
string[] filesindirectory = System.IO.Directory.GetFiles(Server.MapPath(@"\Img\Gallery\Topper-Students\"));
int n = 0;
foreach (string s in filesindirectory)
{
n = s.IndexOf(@"\Img\Gallery\Topper-Students\");
ListTopperStudentsImage.Add(s.Substring(n, s.Length - n));
}
string[] filesindirectory1 = System.IO.Directory.GetFiles(Server.MapPath(ImagePath));
int n1 = 0;
foreach (string s in filesindirectory1)
{
n1 = s.IndexOf(ImagePath);
ListGalleryImage.Add(s.Substring(n1, s.Length - n1));
}
}
}
public void Clear()
{
cmbCourse.ClearSelection();
txtName.Text = "";
txtMobile.Text = "";
txtMessage.Text = "";
txtEmail.Text = "";
txtCity.Text = "";
}
protected void butSubmit_Click(object sender, EventArgs e)
{
txtMessage.Text = txtMessage.Text.ToLower();
int http = txtMessage.Text.ToLower().IndexOf("http");
string Message = " " + txtMessage.Text + " " + txtCity.Text + " " + txtEmail.Text + " " + txtMobile.Text + " " + txtName.Text;
if (http > 0 || Message.ToLower().IndexOf("www") > 0 || Message.ToLower().IndexOf(" sex") > 0
|| Message.ToLower().IndexOf("dating") > 0 || Message.ToLower().IndexOf("adults") > 0
|| Message.ToLower().IndexOf("fuck") > 0 || Message.ToLower().IndexOf("chut") > 0
|| Message.ToLower().IndexOf("choot") > 0 || Message.ToLower().IndexOf("kutta") > 0
|| Message.ToLower().IndexOf("kamina") > 0 || Message.ToLower().IndexOf("gandu") > 0
|| Message.ToLower().IndexOf("gaad") > 0 || Message.ToLower().IndexOf("gaand") > 0
|| Message.ToLower().IndexOf(" chod") > 0 || Message.ToLower().IndexOf("choochi") > 0
|| Message.ToLower().IndexOf("chuchi") > 0 || Message.ToLower().IndexOf("penis") > 0
|| Message.ToLower().IndexOf("lund") > 0 || Message.ToLower().IndexOf("randi") > 0)
{
ScriptManager.RegisterStartupScript(this, GetType(), "set", "alert('Invalid your message, Please ignore illegal words according to education, Otherwise we are inform to Police in cyber crime.');", true);
Response.Redirect("CyberCrime.aspx");
}
if (txtMobile.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
{
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", txtMobile.Text.Trim());
cmd.Parameters.AddWithValue("@City", txtCity.Text.Trim());
cmd.Parameters.AddWithValue("@Qry", txtMessage.Text.Trim());
cmd.Parameters.AddWithValue("@Course", cmbCourse.Text);
n = cmd.ExecuteNonQuery();
obj.CloseConnection();
// Send sms to your mobile
string msg = "Contact to N-" + txtName.Text.ToString() + ", M- " + txtMobile.Text
+ ", C- " + cmbCourse.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);
Clear();
if (n == 1)
{
ScriptManager.RegisterStartupScript(this, GetType(), "set", "alert('Your enquiry save successfully. Our support team contact to you shortly');", true);
Response.Redirect("Welcome.aspx");
}
}
}
}
}
TechEthical Mini WebShell Version 1.0, Coded By The_M@T3