using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Index : System.Web.UI.Page { ModelContainer eng = new ModelContainer(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { getbannerbind(); getservicesbind(); getaboutsbind(); getLecturerbind(); getcoursesbind(); //geteventbind(); //geteventwithimagebind(); getnewsbind(); getnoticebind(); getpostbind(); getEventdetails(); } } private void getEventdetails() { rptevent.DataSource = eng.tbl_Event.Select(i => i).ToList().OrderByDescending(i => i.EventId).Take(6); rptevent.DataBind(); } private void getnoticebind() { reptnotice.DataSource = eng.tbl_Notice.Select(i => i).ToList(); reptnotice.DataBind(); } private void getpostbind() { reptourpost.DataSource = eng.tbl_Post.Select(i => i).ToList(); reptourpost.DataBind(); } private void getnewsbind() { reptnews.DataSource = eng.tbl_News.Select(i => i).ToList(); reptnews.DataBind(); } //private void geteventwithimagebind() //{ // repereaterimageevent.DataSource = eng.tbl_Event.Where(i => i.IsForntViewDefault == "Yes").ToList(); // repereaterimageevent.DataBind(); //} //private void geteventbind() //{ // Repeaterevent.DataSource = eng.tbl_Event.Where(i => i.IsForntViewDefault == "No").ToList(); // Repeaterevent.DataBind(); //} private void getcoursesbind() { repeatercourses.DataSource = eng.tbl_Course.Select(i => i).ToList(); repeatercourses.DataBind(); } private void getLecturerbind() { repeaterteam.DataSource = eng.tbl_Team.Select(i => i).ToList(); repeaterteam.DataBind(); } private void getaboutsbind() { //repeateraboutspage.DataSource = eng.tbl_AboutUs.Select(i => i).ToList(); //repeateraboutspage.DataBind(); } private void getservicesbind() { rptfacility.DataSource = eng.tbl_Facility.Select(i => i).ToList(); rptfacility.DataBind(); } private void getbannerbind() { repeaterbanner.DataSource = eng.tbl_banner.Where(i => i.IsActive == false).ToList(); repeaterbanner.DataBind(); } protected void rptevent_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "ViewEvent") { Session["ViewEvent"] = e.CommandArgument; Response.Redirect("EventDetail.aspx"); } } }