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 System.Data.SqlClient; using System.Configuration; using System.IO; using System.Net.Mail; using System.Net; using System.Web.UI.HtmlControls; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.IO; using System.Net.Mail; using System.Net; using System.Web.UI.HtmlControls; public partial class school1_Default : System.Web.UI.Page { string hostName; int idddd; SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbcon"].ConnectionString); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Uri myuri = new Uri(System.Web.HttpContext.Current.Request.Url.AbsoluteUri); string pathQuery = myuri.PathAndQuery; hostName = myuri.ToString().Replace(pathQuery, ""); if (hostName.StartsWith("www.", StringComparison.OrdinalIgnoreCase)) hostName = hostName.Replace("www.", string.Empty); Session["dom"] = hostName; string text = Request.Url.ToString(); string lastPart = text.Split('=').Last(); Session["sid"] = "9"; gttm(); CTT(); gttt(); gttt1(); tpr(); tprrr(); gttth2(); gtttcer(); gtttCR(); } } private void gttt() { SqlCommand cmd1 = new SqlCommand("SELECT * FROM FACC where REM='Slider' and sid='" + Session["sid"] + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd1); DataTable dt = new DataTable(); da.Fill(dt); Repeater1.DataSource = dt; Repeater1.DataBind(); } private void gtttCR() { SqlCommand cmd1 = new SqlCommand("SELECT * FROM CIR where sid='" + Session["sid"] + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd1); DataTable dt = new DataTable(); da.Fill(dt); Repeater2.DataSource = dt; Repeater2.DataBind(); } private void gtttcer() { SqlCommand cmd1 = new SqlCommand("SELECT id, CAST(date AS DATE) AS date,news FROM cir where sid='" + Session["sid"] + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd1); DataTable dt = new DataTable(); da.Fill(dt); Repeater7.DataSource = dt; Repeater7.DataBind(); } private void tpr() { SqlCommand cmd1 = new SqlCommand("SELECT * FROM FACC where REM='TOPPERS' and sid='" + Session["sid"] + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd1); DataTable dt = new DataTable(); da.Fill(dt); Repeater3.DataSource = dt; Repeater3.DataBind(); } private void CTT() { SqlCommand cmd1 = new SqlCommand("SELECT * FROM commn where sid='" + Session["sid"] + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd1); DataTable dt = new DataTable(); da.Fill(dt); Repeater8.DataSource = dt; Repeater8.DataBind(); } private void tprrr() { SqlCommand cmd1 = new SqlCommand("SELECT * FROM FACC where REM='ACHIEVMENT' and sid='" + Session["sid"] + "'", con); DataRow dr; SqlDataAdapter da = new SqlDataAdapter(cmd1); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count > 0) { dr = dt.Rows[0]; string a = Convert.ToString(dr[0]); Label1.Text = Convert.ToString(dr["name"]); Repeater5.DataSource = dt; Repeater5.DataBind(); } } private void gttm() { DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(); DataRow dr; SqlCommand cmd = new SqlCommand("SELECT * from dbo.mnu where sid='" + Session["sid"] + "'", con); da.SelectCommand = cmd; dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count > 0) { Label2.Text = dt.Rows[3][1].ToString(); Label3.Text = dt.Rows[4][1].ToString(); Label4.Text = dt.Rows[8][0].ToString(); Label5.Text = dt.Rows[7][0].ToString(); } } private void gttth2() { DataRow dr; SqlCommand cmd1 = new SqlCommand("SELECT * FROM epggs where pg='"+Label5.Text+"' and sid='" + Session["sid"] + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd1); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count > 0) { dr = dt.Rows[0]; string a = Convert.ToString(dr[0]); Image2.ImageUrl = Convert.ToString(dr["p1"]); Repeater6.DataSource = dt; Repeater6.DataBind(); } } private void gttt1() { SqlCommand cmd1 = new SqlCommand("SELECT * FROM epggs where pg='"+Label4.Text+"' and sid='"+Session["sid"]+"'", con); SqlDataAdapter da = new SqlDataAdapter(cmd1); DataTable dt = new DataTable(); da.Fill(dt); Repeater4.DataSource = dt; Repeater4.DataBind(); } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { tprrr(); } protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { tpr(); } }