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
            {
                HaberDBEntities2 db = new HaberDBEntities2();
                db.Makale.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 != "")
                {
                    HaberDBEntities2 db = new HaberDBEntities2();
                    db.Üye.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
            {
                HaberDBEntities2 db = new HaberDBEntities2();
                db.Yazar.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
            {
                HaberDBEntities2 db = new HaberDBEntities2();
                db.Kategori.Add(member);
                db.SaveChanges();
                result = true;
            }
            catch (Exception e)
            {
                return(result);
            }

            return(result);
        }
        public bool MemberDogrula(string kullaniciadi, string sifre)
        {
            Üye member = new Üye();



            member.KullaniciAdi = kullaniciadi;
            member.Sifre        = sifre;
            bool result = false;

            try
            {
                HaberDBEntities2 db = new HaberDBEntities2();



                string        query = String.Format("SELECT COUNT(*) FROM Üye WHERE KullaniciAdi Like  '%" + kullaniciadi + "%' AND Sifre Like  '%" + sifre + "%'  ");
                SqlConnection con   = new SqlConnection(sqlConnection);//"workstation id=HaberDB.mssql.somee.com;packet size=4096;user id=senanurkiraz_SQLLogin_1;pwd=njas7u5ikz;data source=HaberDB.mssql.somee.com;persist security info=False;initial catalog=HaberDB");
                SqlCommand    cmd   = new SqlCommand();
                cmd.Connection  = con;
                cmd.CommandText = query;
                con.Open();


                Int32 dr = Convert.ToInt32(cmd.ExecuteScalar());
                if (dr == 0)
                {
                    result = false;
                }


                else
                {
                    result = true;
                }
            }
            catch (Exception)
            {
                return(result);
            }

            return(result);
        }
        public List <Üye> GetMembers()
        {
            HaberDBEntities2 db = new HaberDBEntities2();

            return(db.Üye.ToList());
        }