public void Guncelle(Kitaplar kitap) { using (var db = new KutuphaneDBEntities()) { try { var kitapGuncelle = db.Kitaplar.Where(x => x.id == kitap.id).First(); kitapGuncelle.kitapKodu = kitap.kitapKodu; kitapGuncelle.kitapAdi = kitap.kitapAdi; kitapGuncelle.kategori = kitap.kategori; kitapGuncelle.yayinYili = kitap.yayinYili; kitapGuncelle.yazari = kitap.yazari; kitapGuncelle.ISBN = kitap.ISBN; kitapGuncelle.sayfaSayisi = kitap.sayfaSayisi; db.SaveChanges(); kayitMesaj(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } } }
public void Guncelle(Ogrenciler ogrenci) { using (var db = new KutuphaneDBEntities()) { try { var ogrenciGuncelle = db.Ogrenciler.Where(x => x.id == ogrenci.id).First(); ogrenciGuncelle.ogrenciNo = ogrenci.ogrenciNo; ogrenciGuncelle.ogrenciAd = ogrenci.ogrenciAd; ogrenciGuncelle.ogrenciSoyad = ogrenci.ogrenciSoyad; ogrenciGuncelle.bolumID = ogrenci.bolumID; ogrenciGuncelle.adres = ogrenci.adres; ogrenciGuncelle.memleketAdres = ogrenci.memleketAdres; ogrenciGuncelle.kayitTarih = ogrenci.kayitTarih; ogrenciGuncelle.cepTelefon = ogrenci.cepTelefon; db.SaveChanges(); kayitMesaj(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } } }
public JsonResult Search(string tem) { KutuphaneDBEntities db = new KutuphaneDBEntities(); IEnumerable <Book> lsit = db.Books.Where(b => b.BookName.StartsWith(tem)); var model = from b in lsit select new { id = b.BookID, value = b.BookName, Url = "/Category/Details/" + b.BookID, }; return(Json(model, JsonRequestBehavior.AllowGet)); }
public void Ekle(Kitaplar kitap) { using (var db = new KutuphaneDBEntities()) { try { db.Kitaplar.Add(kitap); db.SaveChanges(); KayitMesaj(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } } }
public void Ekle(Ogrenciler ogrenci) { using (var db = new KutuphaneDBEntities()) { try { db.Ogrenciler.Add(ogrenci); db.SaveChanges(); kayitMesaj(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } } }
public void Ekle(Fakulte fakulte) { using (var db = new KutuphaneDBEntities()) { try { db.Fakulte.Add(fakulte); db.SaveChanges(); KayitMesaj(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } } }
public void Guncelle(Ogrenciler ogrenci) { using (var db = new KutuphaneDBEntities()) { try { var ogrenciGuncelle = db.Ogrenciler.Where(x => x.id == ogrenci.id).First(); ogrenciGuncelle.ogrenciNo = ogrenci.ogrenciNo; ogrenciGuncelle.ogrenciAd = ogrenci.ogrenciAd; ogrenciGuncelle.ogrenciSoyad = ogrenci.ogrenciSoyad; ogrenciGuncelle.bolumID = ogrenci.bolumID; ogrenciGuncelle.adres = ogrenci.adres; ogrenciGuncelle.memleketAdres = ogrenci.memleketAdres; ogrenciGuncelle.kayitTarih = ogrenci.kayitTarih; ogrenciGuncelle.cepTelefon = ogrenci.cepTelefon; db.SaveChanges(); kayitMesaj(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } } /* * * public void KitapDuzenle(string KitapAdi, Kitaplar kitap) * { * using (var db = new KisiKitap()) * { * var duzenlenecekkitap = db.Kitaplar.Where(p => p.Adi == KitapAdi).First(); * duzenlenecekkitap.Adi = kitap.Adi; * duzenlenecekkitap.Fiyatı = kitap.Fiyatı; * duzenlenecekkitap.Yazari = kitap.Yazari; * db.SaveChanges(); * } * } * */ }
public void TeslimAl(string kitapAdi, bool durum, DateTime date) { using (var db = new KutuphaneDBEntities()) { try { Odunc odunc = (from o in db.Odunc where o.Kitaplar.kitapAdi == kitapAdi select o).FirstOrDefault(); odunc.oduncDurum = durum; odunc.teslimTarih = date; db.SaveChanges(); kayitMesaj(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } } }
public bool Kontrol(string adminName, string adminPass) { var db = new KutuphaneDBEntities(); var admin = from x in db.Admin where x.adminName == adminName && x.adminPassword == adminPass select x; foreach (var item in admin) { if (item.adminName == adminName && item.adminPassword == adminPass) { return(true); } else { return(false); } } return(false); }