public int GetLastElement() { try { datacontext db = new datacontext(); return(db.haberler.OrderByDescending(p => p.id).FirstOrDefault().id); } catch (Exception) { return(1); throw; } }
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; } }
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; } }
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; } }
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; } }