public bool AddMakale(int yazarid, int kategoriid, string baslik, string icerik) { Makale member = new Makale(); member.YazarID = yazarid; member.KategoriID = kategoriid; member.Baslık = baslik; member.Icerik = icerik; bool result = false; try { HaberDBEntities1 db = new HaberDBEntities1(); db.Makale.Add(member); db.SaveChanges(); result = true; } catch (Exception) { return(result); } return(result); }
public bool AddYazar(string yazaradi) { Yazar member = new Yazar(); member.YazarAdi = yazaradi; bool result = false; try { HaberDBEntities1 db = new HaberDBEntities1(); db.Yazar.Add(member); db.SaveChanges(); result = true; } catch (Exception) { return(result); } return(result); }
public bool AddMember(string ad, string soyad, string email, string kullaniciadi, string sifre) { Üye member = new Üye(); member.Ad = ad; member.Soyad = soyad; member.Email = email; member.KullaniciAdi = kullaniciadi; member.Sifre = sifre; bool result = false; try { if (ad != "" && soyad != "" && email != "" && kullaniciadi != "" && sifre != "") { HaberDBEntities1 db = new HaberDBEntities1(); db.Üye.Add(member); db.SaveChanges(); result = true; } } catch (Exception) { return(result); } return(result); }
public bool AddKategori(string kategoriadi) { Kategori member = new Kategori(); member.KategoriAdi = kategoriadi; bool result = false; try { HaberDBEntities1 db = new HaberDBEntities1(); db.Kategori.Add(member); db.SaveChanges(); result = true; } catch (Exception e) { return(result); } return(result); }