protected void Page_Load(object sender, EventArgs e) { BookEntities db = new BookEntities(); var results = (from i in db.BookLists select i).ToList(); booksList.DataSource = results; booksList.DataBind(); }
public void yorumlariGetir(int id) { using (BookEntities db = new BookEntities()) { var result = (from i in db.Yorumlars where i.KitapId == id select i).ToList(); comments.DataSource = result; comments.DataBind(); } }
public void kitapGetir(int id) { using (BookEntities db = new BookEntities()) { var result = (from i in db.BookLists where i.id == id select i).ToList(); books.DataSource = result; books.DataBind(); } }
public void yorumKayit(string yorum, int id) { using (BookEntities db = new BookEntities()) { try { Yorumlar c = new Yorumlar(); c.KitapId = id; c.UyeId = 1; c.Yorum = yorum; c.YorumTarih = DateTime.Now; db.Yorumlars.Add(c); db.SaveChanges(); } catch (Exception) { throw; } } }
protected void Button1_Click(object sender, EventArgs e) { var sifre = TextBox1.Text; string mail = TextBox2.Text; using (BookEntities db = new BookEntities()) { var result = (from i in db.Uyelers where i.UyeMail == mail select i).ToList(); foreach (var i in result) { if (sifre.Equals(i.UyeSifre)) { HtmlMeta meta = new HtmlMeta(); meta.HttpEquiv = "Refresh"; meta.Content = "1;url=MemberPage/MembesBooksPage.aspx"; this.Page.Controls.Add(meta); loginInfo.loginId = i.UyeId; loginInfo.uyeAdi = i.UyeAdi; } } }; }