Пример #1
0
        public int GetLastElement()
        {
            try
            {
                datacontext db = new datacontext();
                return(db.haberler.OrderByDescending(p => p.id).FirstOrDefault().id);
            }
            catch (Exception)
            {
                return(1);

                throw;
            }
        }
Пример #2
0
        public string GetBeforePics(HtmlString id)
        {
            try
            {
                int         tempid = int.Parse(id.ToString());
                datacontext db     = new datacontext();
                //   return (db.haberler.Where(p => p.id < Convert.ToInt16(id)).OrderByDescending(p => p.id).FirstOrDefault().id);
                return(db.haberler.Where(p => p.id < tempid).OrderByDescending(p => p.id).FirstOrDefault().resimuri.ToString());
            }
            catch (Exception)
            {
                return("~~/Content/images/logo.png");

                throw;
            }
        }
Пример #3
0
        public string GetBeforeElement(HtmlString id)
        {
            try
            {
                int         tempid = int.Parse(id.ToString());
                datacontext db     = new datacontext();
                //   return (db.haberler.Where(p => p.id < Convert.ToInt16(id)).OrderByDescending(p => p.id).FirstOrDefault().id);
                return("./" + db.haberler.Where(p => p.id < tempid).OrderByDescending(p => p.id).FirstOrDefault().id.ToString());
            }
            catch (Exception)
            {
                return("./1");

                throw;
            }
        }
Пример #4
0
        public string GetAfterPic(HtmlString id)
        {
            try
            {
                int         tempid = int.Parse(id.ToString());
                datacontext db     = new datacontext();
                return(db.haberler.Where(p => p.id > tempid).OrderBy(p => p.id).FirstOrDefault().resimuri.ToString());
            }
            catch (Exception)
            {
                //En son elementten sonrası bulunamadı
                return("~~/Content/images/logo.png");

                throw;
            }
        }
Пример #5
0
        public string GetAfterElement(HtmlString id)
        {
            try
            {
                int         tempid = int.Parse(id.ToString());
                datacontext db     = new datacontext();
                return("./" + db.haberler.Where(p => p.id > tempid).OrderBy(p => p.id).FirstOrDefault().id.ToString());
            }
            catch (Exception)
            {
                //En son elementten sonrası bulunamadı
                return("./1");

                throw;
            }
        }