Example #1
0
    public void BindService()
    {
        DataSet dse = new DataSet();

        dse = objsql.GetDataset("select top 3 * from tblService where Status='1' order by newid()");
        if (dse.Tables[0].Rows.Count > 0)
        {
            ListService.DataSource = dse;
            ListService.DataBind();
        }
        dse.Clear();
    }
    public void BindService()
    {
        DataSet dse = new DataSet();

        dse = objsql.GetDataset("select top 3 * from tblService where Status='1' and type='Migration' order by Newid()");
        if (dse.Tables[0].Rows.Count > 0)
        {
            ListService.DataSource = dse;
            ListService.DataBind();
        }
        dse.Clear();
        DataTable dt = new DataTable();

        dt = objsql.GetTable("select top 3 * from tblService where Status='1' and type='Study Abroad' order by Newid()");
        if (dt.Rows.Count > 0)
        {
            lvabroad.DataSource = dt;
            lvabroad.DataBind();
        }
    }
Example #3
0
        protected void Doldur(string code, int ID)
        {
            ListService.DataSource = (from s in db.Services
                                      where s.IsActive == true
                                      join l in db.Language on s.LanguageID equals l.ID
                                      where l.Code == code
                                      orderby s.ID ascending
                                      select new
            {
                BigWriting = (s.BigWriting.Length > 150) ? s.BigWriting.Substring(0, 149) : s.BigWriting,
                Title = s.Title,
                Img = s.Image
            }).Take(4).ToList();
            ListService.DataBind();

            listReferance.DataSource = (from r in db.Referance
                                        where r.IsActive == true
                                        join l in db.Language on r.LanguageID equals l.ID
                                        where l.Code == code
                                        select r).ToList();
            listReferance.DataBind();

            ListNews.DataSource = (from n in db.News
                                   where n.IsActive == true
                                   join l in db.Language on n.LanguageID equals l.ID
                                   where l.Code == code
                                   orderby n.ID descending
                                   select new
            {
                SmallWriting = (n.SmallWriting.Length > 150) ? n.SmallWriting.Substring(0, 149) : n.SmallWriting,
                Title = n.Title,
                Image = n.Image,
                ID = n.ID
            }).Take(3).ToList();
            ListNews.DataBind();

            ListSolution.DataSource = (from s in db.Solution
                                       where s.IsActive == true
                                       join l in db.Language on s.LanguageID equals l.ID
                                       where l.Code == code
                                       orderby s.ID ascending
                                       select new
            {
                Title = s.Title,
                SmallWriting = (s.SmallWriting.Length > 150) ? s.SmallWriting.Substring(0, 149) : s.SmallWriting
            }).Take(4).ToList();
            ListSolution.DataBind();

            int firstSliderID = (from s in db.Slider
                                 where s.IsActive == true
                                 join l in db.Language on s.LanguageID equals l.ID
                                 where l.Code == code
                                 select s.ID).FirstOrDefault();

            AnalitikBilisimSite.Model.Entities.Slider slider1 = (from s in db.Slider where s.ID == (firstSliderID) && s.IsActive == true && s.LanguageID == ID select s).FirstOrDefault();
            AnalitikBilisimSite.Model.Entities.Slider slider2 = (from s in db.Slider where s.ID == (firstSliderID + 1) && s.IsActive == true && s.LanguageID == ID select s).FirstOrDefault();
            AnalitikBilisimSite.Model.Entities.Slider slider3 = (from s in db.Slider where s.ID == (firstSliderID + 2) && s.IsActive == true && s.LanguageID == ID select s).FirstOrDefault();

            ImageSlider1.ImageUrl  = slider1.SliderURL;
            lblSliderTitle1.Text   = slider1.sliderTitle;
            lblSliderWriting1.Text = slider1.SliderWriting;

            ImageSlider2.ImageUrl  = slider2.SliderURL;
            lblSliderTitle2.Text   = slider2.sliderTitle;
            lblSliderWriting2.Text = slider2.SliderWriting;

            ImageSlider3.ImageUrl  = slider3.SliderURL;
            lblSliderTitle3.Text   = slider3.sliderTitle;
            lblSliderWriting3.Text = slider3.SliderWriting;
        }