using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using nmsSetup; using System.Data; using System.Configuration; using System.Data.SqlClient; public partial class MasterPage : System.Web.UI.MasterPage { clsBLSetup b; PRPSetup obj; SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["data"] == null) { bindMenuDataNew(); } else { DataTable dt = (DataTable)Session["data"]; bind_aboutus(dt); bind_placement(dt); bind_student(dt); bind_notice(dt); bind_Training_Center(dt); bind_Find_center(dt); bind_Industry(dt); bind_RMSDE(dt); bind_RNSDC(dt); bind_RSECTOR(dt); bind_RMINISTRY(dt); bind_RSSDM(dt); bind_ReMINISTRY(dt); bind_RTEXTILE(dt); bind_RAFFAIRS(dt); bind_REMPOWERMENT(dt); bind_RTOURISM(dt); bind_RNational(dt); bind_Central_Eng(dt); bind_reptMiscellaneous(dt); bind_reptCSReng(dt); bind_reptInternational_eng(dt); bind_reptState_eng(dt); } me_counter.InnerText = Application["maxValue"].ToString(); //bind_aboutus(); bindcourse_menu1(); } } private void bindMenuDataNew() { SqlDataAdapter adp = new SqlDataAdapter("view_TextDetail_I", con); DataTable dt = new DataTable(); adp.Fill(dt); Session["data"] = dt; adp.Dispose(); con.Close(); if(dt.Rows.Count>0) { bind_aboutus(dt); bind_placement(dt); bind_student(dt); bind_notice(dt); bind_Training_Center(dt); bind_Find_center(dt); bind_Industry(dt); bind_RMSDE(dt); bind_RNSDC(dt); bind_RSECTOR(dt); bind_RMINISTRY(dt); bind_RSSDM(dt); bind_ReMINISTRY(dt); bind_RTEXTILE(dt); bind_RAFFAIRS(dt); bind_REMPOWERMENT(dt); bind_RTOURISM(dt); bind_RNational(dt); bind_Central_Eng(dt); bind_reptMiscellaneous(dt); bind_reptCSReng(dt); bind_reptInternational_eng(dt); bind_reptState_eng(dt); } } public void bindcourse_menu() { obj = new PRPSetup(); b = new clsBLSetup(); List lst = new List(); obj.uniID = "0"; lst = b.view_coursetype_new(obj); if (lst.Count > 0) { Repcaurse.DataSource = lst; Repcaurse.DataBind(); } } public void bindcourse_menu1() { obj = new PRPSetup(); b = new clsBLSetup(); List lst = new List(); obj.id = "5052"; obj.Type = "0"; lst = b.View_CourseTypeBY_UniId(obj); if (lst.Count > 0) { Repcaurse.DataSource = lst; Repcaurse.DataBind(); } } public void bind_Central_Eng(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "1030"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // reptCentral.DataSource = lst1; // reptCentral.DataBind(); //} string id = "1030"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { reptCentral.DataSource = stuData; reptCentral.DataBind(); } } public void bind_reptMiscellaneous(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "1034"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // reptMiscellaneous.DataSource = lst1; // reptMiscellaneous.DataBind(); //} string id = "1034"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { reptMiscellaneous.DataSource = stuData; reptMiscellaneous.DataBind(); } } public void bind_reptCSReng(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "1033"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // reptCSReng.DataSource = lst1; // reptCSReng.DataBind(); //} string id = "1033"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { reptCSReng.DataSource = stuData; reptCSReng.DataBind(); } } public void bind_reptInternational_eng(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "1032"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // reptInternational_eng.DataSource = lst1; // reptInternational_eng.DataBind(); //} string id = "1032"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { reptInternational_eng.DataSource = stuData; reptInternational_eng.DataBind(); } } public void bind_reptState_eng(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "1031"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // reptState_eng.DataSource = lst1; // reptState_eng.DataBind(); //} string id = "1031"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { reptState_eng.DataSource = stuData; reptState_eng.DataBind(); } } public List bindcourse(string a) { obj = new PRPSetup(); b = new clsBLSetup(); List lst = new List(); obj.id = a; obj.Type = "0"; lst = b.View_CourseName_Catid(obj); return lst; } protected void Repcaurse_ItemDataBound(object sender, RepeaterItemEventArgs e) { try { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { Label lbl_userid = (Label)e.Item.FindControl("lblid"); string id = lbl_userid.Text; Repeater Chi_Repeat = (Repeater)e.Item.FindControl("Repeater2CourseTYpe"); Chi_Repeat.DataSource = bindcourse(id); Chi_Repeat.DataBind(); } } catch { } } public List bind_links(string id) { obj = new PRPSetup(); b = new clsBLSetup(); List lst = new List(); obj.uniID = id; lst = b.view_fullcoursecategory_detail(obj); return lst; } public void bind_aboutus(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "7"; //lst1 = b.view_TextDetail(obj); string id = "7"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID="+ id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { About_menu.DataSource = stuData; About_menu.DataBind(); } //if (lst1.Count > 0) //{ // About_menu.DataSource = lst1; // About_menu.DataBind(); //} } public void bind_RMSDE(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "16"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // RMSDE.DataSource = lst1; // RMSDE.DataBind(); //} string id = "16"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { RMSDE.DataSource = stuData; RMSDE.DataBind(); } } public void bind_RNSDC(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "17"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // RNSDC.DataSource = lst1; // RNSDC.DataBind(); //} string id = "17"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { RNSDC.DataSource = stuData; RNSDC.DataBind(); } } public void bind_RSECTOR(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "18"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // RSECTOR.DataSource = lst1; // RSECTOR.DataBind(); //} string id = "18"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { RSECTOR.DataSource = stuData; RSECTOR.DataBind(); } } public void bind_RMINISTRY(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "19"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // RMINISTRY.DataSource = lst1; // RMINISTRY.DataBind(); //} string id = "19"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { RMINISTRY.DataSource = stuData; RMINISTRY.DataBind(); } } public void bind_RSSDM(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "20"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // RSSDM.DataSource = lst1; // RSSDM.DataBind(); //} string id = "20"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { RSSDM.DataSource = stuData; RSSDM.DataBind(); } } public void bind_ReMINISTRY(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "21"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // ReMINISTRY.DataSource = lst1; // ReMINISTRY.DataBind(); //} string id = "21"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { ReMINISTRY.DataSource = stuData; ReMINISTRY.DataBind(); } } public void bind_RTEXTILE(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "22"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // RTEXTILE.DataSource = lst1; // RTEXTILE.DataBind(); //} string id = "22"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { RTEXTILE.DataSource = stuData; RTEXTILE.DataBind(); } } public void bind_RAFFAIRS(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "23"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // RAFFAIRS.DataSource = lst1; // RAFFAIRS.DataBind(); //} string id = "23"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { RAFFAIRS.DataSource = stuData; RAFFAIRS.DataBind(); } } public void bind_REMPOWERMENT(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "24"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // REMPOWERMENT.DataSource = lst1; // REMPOWERMENT.DataBind(); //} string id = "24"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { REMPOWERMENT.DataSource = stuData; REMPOWERMENT.DataBind(); } } public void bind_RTOURISM(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "25"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // RTOURISM.DataSource = lst1; // RTOURISM.DataBind(); //} string id = "25"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { RTOURISM.DataSource = stuData; RTOURISM.DataBind(); } } public void bind_RNational(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "28"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // RNational.DataSource = lst1; // RNational.DataBind(); //} string id = "28"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { RNational.DataSource = stuData; RNational.DataBind(); } } public void bind_placement(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "12"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // Reptplacement.DataSource = lst1; // Reptplacement.DataBind(); //} string id = "12"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { Reptplacement.DataSource = stuData; Reptplacement.DataBind(); } } public void bind_student(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "14"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // reptstudentcorner.DataSource = lst1; // reptstudentcorner.DataBind(); //} string id = "14"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { reptstudentcorner.DataSource = stuData; reptstudentcorner.DataBind(); } } public void bind_notice(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst1 = new List(); //obj.catID = "15"; //lst1 = b.view_TextDetail(obj); //if (lst1.Count > 0) //{ // reptnotice.DataSource = lst1; // reptnotice.DataBind(); //} string id = "15"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { reptnotice.DataSource = stuData; reptnotice.DataBind(); } } public void bind_Training_Center(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst = new List(); //obj.catID = "8"; //lst = b.view_TextDetail(obj); //if (lst.Count > 0) //{ // Repttrainingcenter.DataSource = lst; // Repttrainingcenter.DataBind(); //} string id = "8"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { Repttrainingcenter.DataSource = stuData; Repttrainingcenter.DataBind(); } } public void bind_Find_center(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst = new List(); //obj.catID = "9"; //lst = b.view_TextDetail(obj); //if (lst.Count > 0) //{ // ReptFindCenter.DataSource = lst; // ReptFindCenter.DataBind(); //} string id = "9"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { ReptFindCenter.DataSource = stuData; ReptFindCenter.DataBind(); } } public void bind_Industry(DataTable ds) { //obj = new PRPSetup(); //b = new clsBLSetup(); //List lst = new List(); //obj.catID = "10"; //lst = b.view_TextDetail(obj); //if (lst.Count > 0) //{ // Reptpartner.DataSource = lst; // Reptpartner.DataBind(); //} string id = "10"; DataTable stuData = new DataTable(); DataRow[] d_row = ds.Select("catID=" + id); bool exists = ds.Select().ToList().Exists(row => row["catID"].ToString().ToUpper() == id); if (exists == true) { stuData = d_row.CopyToDataTable(); } if (stuData.Rows.Count > 0) { Reptpartner.DataSource = stuData; Reptpartner.DataBind(); } } }