/// <summary>
        /// butona tiklandiginda DR'den veri ekleyen fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDergiEkleDR_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnDergiEkleDR.Name, adminUserNesnesi.userName);
            Bitmap         bitti       = new Bitmap("D:\\dergiadi" + dgwsirasi + ".jpg");
            SaveFileDialog dosyaKaydet = new SaveFileDialog();
            SQLdergi       cek         = new SQLdergi();

            cek.dergileriSQLdenCek();
            magazineNesnesi.Name = dgwDr.Rows[dgwsirasi].Cells[0].Value.ToString();
            dosyaKaydet.FileName = @"DergiFotograf\dergi" + (SQLdergi.sonid + 1) + ".png";
            bitti.Save(dosyaKaydet.FileName);

            magazineNesnesi.Price         = double.Parse(dgwDr.Rows[dgwsirasi].Cells[1].Value.ToString());
            magazineNesnesi.Issue         = txtSayi1.Text;
            magazineNesnesi.ImageLocation = "DergiFotograf\\dergi" + (SQLdergi.sonid + 1) + ".png";

            magazineNesnesi.Type = (Magazine.typeOfMagazine)cmbDergiTur.SelectedIndex;
            SQLdergi.sonid++;

            adminUserNesnesi.addNewItem(magazineNesnesi);
            //dergi.dergileriSQLeEkle(magazineNesnesi);
            tabloGoster();
        }
Beispiel #2
0
        /// <summary>
        /// butona tiklandiginda DR'den veri ekleyen fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCdEkleDR_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnCdEkleDR.Name, adminUserNesnesi.userName);
            Bitmap         bitti       = new Bitmap("D:\\cdadi" + dgwsirasi + ".jpg");
            SaveFileDialog dosyaKaydet = new SaveFileDialog();
            SQLmusicCd     cek         = new SQLmusicCd();

            cek.muzikCDleriSQLdenCek();
            musicCDnesnesi.Name  = dgwDr.Rows[dgwsirasi].Cells[0].Value.ToString();
            dosyaKaydet.FileName = @"MuzikCDFotograf\muzikCd" + (SQLmusicCd.sonid + 1) + ".png";
            bitti.Save(dosyaKaydet.FileName);



            musicCDnesnesi.Price         = double.Parse(dgwDr.Rows[dgwsirasi].Cells[1].Value.ToString());
            musicCDnesnesi.Singer        = dgwDr.Rows[dgwsirasi].Cells[2].Value.ToString();
            musicCDnesnesi.Type          = (MusicCD.typeOfMusicCD)cmbTur1.SelectedIndex;
            musicCDnesnesi.ImageLocation = @"MuzikCDFotograf\muzikCd" + (SQLmusicCd.sonid + 1) + ".png";
            SQLmusicCd.sonid++;
            adminUserNesnesi.addNewItem(musicCDnesnesi);
            //muzikCd.MusicCdSQLeEkle(musicCDnesnesi);
            tabloGoster();
        }
Beispiel #3
0
        /// <summary>
        /// butona tiklandiginda DR'den kitap ekleyen fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnKitapEkleDR_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnKitapEkleDR.Name, adminUserNesnesi.userName);
            Bitmap         bitti       = new Bitmap("D:\\Resimadi" + dgwsirasi + ".jpg");
            SaveFileDialog dosyaKaydet = new SaveFileDialog();
            SQLkitap       cek         = new SQLkitap();

            cek.kitaplariSQLdenCek();
            bookNesnesi.Name       = dgwDr.Rows[dgwsirasi].Cells[0].Value.ToString();
            bookNesnesi.IsbnNumber = txtIsbnDR.Text;
            dosyaKaydet.FileName   = @"KitapFotograf\kitap" + (SQLkitap.sonid + 1) + ".png";
            bitti.Save(dosyaKaydet.FileName);

            bookNesnesi.Price              = double.Parse(dgwDr.Rows[dgwsirasi].Cells[1].Value.ToString());
            bookNesnesi.IsbnNumber         = txtIsbnDR.Text;
            bookNesnesi.Author             = dgwDr.Rows[dgwsirasi].Cells[2].Value.ToString();
            bookNesnesi.Publisher          = dgwDr.Rows[dgwsirasi].Cells[3].Value.ToString();
            bookNesnesi.Page               = int.Parse(dgwDr.Rows[dgwsirasi].Cells[4].Value.ToString());
            bookNesnesi.Cover_page_picture = "KitapFotograf\\kitap" + (SQLkitap.sonid + 1) + ".png";
            bookNesnesi.ImageLocation      = "KitapFotograf\\kitap" + (SQLkitap.sonid + 1) + ".png";
            bookNesnesi.TypeOfBook         = cmbKitapDR.Text;
            SQLkitap.sonid++;
            adminUserNesnesi.addNewItem(bookNesnesi);
            //kitap.kitaplariSQLeEkle(bookNesnesi);
            tabloGoster();
        }
Beispiel #4
0
        /// <summary>
        /// butona tiklandiginda eklenen adminin bilgileri girildikten sonra kayit eden fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnKayitOlOnay_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnKayitOlOnay.Name, adminUserNesnesi.userName);
            kayitOlAdmin();
        }
        /// <summary>
        /// admin tarafindan muzik cd ekleyen fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMuzikCdEkle_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnMuzikCdEkle.Name, adminUserNesnesi.userName);
            FormEkleMuzikCd formEkleMuzikCd_obj = new FormEkleMuzikCd();

            formEkleMuzikCd_obj.gbxEkle.Enabled = true;
            formEkleMuzikCd_obj.gbxSil.Visible  = false;
            formEkleMuzikCd_obj.Show();
        }
        /// <summary>
        /// admin tarafindan dergi silen fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDergiSil_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnDergiSil.Name, adminUserNesnesi.userName);
            FormEkleDergi formEkleDergi_obj = new FormEkleDergi();

            formEkleDergi_obj.gbxSil.Visible  = true;
            formEkleDergi_obj.gbxEkle.Enabled = false;
            formEkleDergi_obj.Show();
        }
        /// <summary>
        /// admin tarafindan butona tiklandiginda dergi ekleyen fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDergiEkle_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnDergiEkle.Name, adminUserNesnesi.userName);
            DergiFotoAl();
            nesneDoldur();
            adminUserNesnesi.addNewItem(magazineNesnesi);
            //dergi.dergileriSQLeEkle(magazineNesnesi);
            tabloGoster();
        }
Beispiel #8
0
        /// <summary>
        /// admin tarafindan butona tiklandiginda kitap ekleyen fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnKitapEkle_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnKitapEkle.Name, adminUserNesnesi.userName);
            KitapFotoAl();
            nesneDoldur();
            adminUserNesnesi.addNewItem(bookNesnesi);
            //kitap.kitaplariSQLeEkle(bookNesnesi);
            tabloGoster();
        }
Beispiel #9
0
        /// <summary>
        /// admin tarafindan butona tiklandiginda muzik cd ekleyen fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMuzikCdEkle_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnMuzikCdEkle.Name, adminUserNesnesi.userName);
            MuzikCdFotoAl();
            nesneDoldur();
            adminUserNesnesi.addNewItem(musicCDnesnesi);
            //muzikCd.MusicCdSQLeEkle(musicCDnesnesi);
            tabloGoster();
            MessageBox.Show("eklendi");
        }
        /// <summary>
        /// admin tarafindan yeni admin ekleyen fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnYeniAdminEkle_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnYeniAdminEkle.Name, adminUserNesnesi.userName);
            AdminUser     admin             = AdminUser.adminUser;
            FormEkleAdmin formEkleAdmin_obj = new FormEkleAdmin();

            formEkleAdmin_obj.gbxEkle.Enabled = true;
            formEkleAdmin_obj.gbxSil.Visible  = false;
            formEkleAdmin_obj.Show();
        }
        /// <summary>
        /// admin tarafindan muzik cd silen fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void linkLblAdminCikis_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, linkLblAdminCikis.Name, adminUserNesnesi.userName);
            FormAnaEkran anaEkran = FormAnaEkran.formAnaEkran;

            anaEkran.linklblCikisYap.Visible  = false;
            anaEkran.linklblKayitOl.Visible   = true;
            anaEkran.linklblUyeGirisi.Visible = true;
            adminUserNesnesi = null;
            this.Close();
        }
Beispiel #12
0
        /// <summary>
        /// butona tiklandiginda DR'den muzik cd ceken fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnVeriCekMusicCdDr_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnVeriCekMusicCdDr.Name, adminUserNesnesi.userName);
            WebClient client = new WebClient();
            Uri       url    = new Uri("https://www.dr.com.tr/Sectiklerimiz/Muzik");

            client.Encoding = Encoding.UTF8;

            var    html1 = client.DownloadData(url);
            string html  = Encoding.UTF8.GetString(html1);

            HtmlAgilityPack.HtmlDocument dokuman = new HtmlAgilityPack.HtmlDocument();
            dokuman.LoadHtml(html);

            HtmlNodeCollection resim = dokuman.DocumentNode.SelectNodes("//img[@class='lazyload']");

            HtmlNodeCollection ad = dokuman.DocumentNode.SelectNodes("//h3");

            HtmlNodeCollection fiyat   = dokuman.DocumentNode.SelectNodes("//span[@class='old-price']");
            HtmlNodeCollection sarkici = dokuman.DocumentNode.SelectNodes("//a[@class='who']");

            string duzeltme, gecicifiyat;

            DataGridViewImageColumn resim11 = new DataGridViewImageColumn();

            dgwDr.Columns.Add(resim11);
            resim11.ImageLayout = DataGridViewImageCellLayout.Stretch;

            for (int i = 0; i < fiyat.Count; i++)
            {
                gecicifiyat = "";
                var adi = ad[i];
                duzeltme = yerineKoy(adi.InnerText);
                dgwDr.Rows.Add(duzeltme.ToString());

                var fiyati = fiyat[i];
                for (int t = 0; t < fiyati.InnerLength - 3; t++)
                {
                    gecicifiyat += fiyati.InnerText[t];
                }
                dgwDr.Rows[i].Cells[1].Value = gecicifiyat;

                var kim = sarkici[i];
                duzeltme = yerineKoy(kim.InnerText);
                dgwDr.Rows[i].Cells[2].Value = duzeltme.ToString();

                var imge = resim[i].Attributes["data-src"].Value;

                dgwDr.Rows[i].Cells[3].Value = imge.ToString();

                imageİndirNet dmage = new imageİndirNet(imge);
                dmage.Download();
                try
                { dmage.SaveImage("D:\\cdadi" + i + ".jpg", ImageFormat.Jpeg); }
                catch (Exception)
                {
                    dmage.SaveImage("D:\\cdadi" + i + ".png", ImageFormat.Png);
                }

                try
                {
                    dgwDr.Rows[i].Cells[4].Value = Image.FromFile("D:\\cdadi" + i + ".jpg");
                    dgwDr.Rows[i].Cells[3].Value = "D:\\cdadi" + i + ".jpg";
                }
                catch (Exception)
                {
                    dgwDr.Rows[i].Cells[5].Value = Image.FromFile("D:\\cdadi" + i + ".png");
                }
            }
        }
        /// <summary>
        /// butona tiklandiginda DR'den veri ceken fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnVeriCekDergiDr_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnVeriCekDergiDr.Name, adminUserNesnesi.userName);
            WebClient client = new WebClient();
            Uri       url    = new Uri("https://www.dr.com.tr/Search?q=dergi#/page=1/sort=relevance,desc/categoryid=0/parentId=0/lg=undefined/price=-1,-1/ldir=h");

            client.Encoding = Encoding.UTF8;

            var    html1 = client.DownloadData(url);
            string html  = Encoding.UTF8.GetString(html1);

            HtmlAgilityPack.HtmlDocument dokuman = new HtmlAgilityPack.HtmlDocument();
            dokuman.LoadHtml(html);
            //HtmlNodeCollection basliklar = dokuman.DocumentNode.SelectNodes("//a[@href]");


            HtmlNodeCollection resim = dokuman.DocumentNode.SelectNodes("//img");

            HtmlNodeCollection ad = dokuman.DocumentNode.SelectNodes("//img[@src]");

            HtmlNodeCollection fiyat = dokuman.DocumentNode.SelectNodes("//span[@class='old-price']");

            DataGridViewImageColumn resim11 = new DataGridViewImageColumn();

            dgwDr.Columns.Add(resim11);

            resim11.ImageLayout = DataGridViewImageCellLayout.Stretch;


            for (int i = 0; i < fiyat.Count; i++)
            {
                gecicifiyat = "";
                var adi = ad[i + 1].Attributes["alt"].Value;
                adi = yerineKoy(adi);
                dgwDr.Rows.Add(adi.ToString());

                var fiyati = fiyat[i];
                for (int t = 0; t < fiyati.InnerLength - 3; t++)
                {
                    gecicifiyat += fiyati.InnerText[t];
                }
                dgwDr.Rows[i].Cells[1].Value = gecicifiyat;



                var imge = resim[i + 1].Attributes["src"].Value;

                imageİndirNet dmage = new imageİndirNet(imge);
                dmage.Download();
                try
                { dmage.SaveImage("D:\\dergiadi" + i + ".jpg", ImageFormat.Jpeg); }
                catch (Exception)
                {
                    dmage.SaveImage("D:\\dergiadi" + i + ".png", ImageFormat.Png);
                }

                try
                {
                    dgwDr.Rows[i].Cells[3].Value = Image.FromFile("D:\\dergiadi" + i + ".jpg");
                    dgwDr.Rows[i].Cells[2].Value = "D:\\dergiadi" + i + ".jpg";
                }
                catch (Exception)
                {
                    dgwDr.Rows[i].Cells[3].Value = Image.FromFile("D:\\dergiadi" + i + ".png");
                }
            }
        }
Beispiel #14
0
        /// <summary>
        /// butona tiklandiginda DR'den veri ceken fonksiyon
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnVeriCekKitapDr_Click(object sender, EventArgs e)
        {
            AdminUser adminUserNesnesi = FormAnaEkran.AdminUserNesnesi;

            adminUserNesnesi.logAdmin(this, btnVeriCekKitapDr.Name, adminUserNesnesi.userName);
            Random    rastgele = new Random();
            WebClient client   = new WebClient();

            client.Encoding = System.Text.Encoding.GetEncoding(1254);
            Uri url = new Uri("https://www.dr.com.tr/CokSatanlar/Kitap#/page=2/sort=groups.group.displayorder,asc/categoryid=0/clog=4020/parentId=0/price=-1,-1");

            client.Encoding = Encoding.UTF8;



            Encoding.GetEncoding("iso-8859-9");

            var    html1 = client.DownloadData(url);
            string html  = Encoding.UTF8.GetString(html1);

            HtmlAgilityPack.HtmlDocument dokuman = new HtmlAgilityPack.HtmlDocument();
            dokuman.LoadHtml(html);
            HtmlNodeCollection basliklar = dokuman.DocumentNode.SelectNodes("//a[@href]");

            HtmlNodeCollection sayfa = dokuman.DocumentNode.SelectNodes("//a[@title]");

            HtmlNodeCollection resim = dokuman.DocumentNode.SelectNodes("//img[@class='lazyload']");

            HtmlNodeCollection ad      = dokuman.DocumentNode.SelectNodes("//div[@class='cell']");
            HtmlNodeCollection fiyat   = dokuman.DocumentNode.SelectNodes("//span[@class='old-price']");
            HtmlNodeCollection yazar   = dokuman.DocumentNode.SelectNodes("//a[@class='who']");
            HtmlNodeCollection yayinci = dokuman.DocumentNode.SelectNodes("//a[@class='who mb10']");
            HtmlNodeCollection tipi    = dokuman.DocumentNode.SelectNodes("//div[@class='cell']");
            //HtmlNodeCollection sayfa=dokuman.DocumentNode.SelectNodes("//div[@style]");

            string adi, duzeltme, tpi;



            for (int i = 0; i < ad.Count; i++)
            {
                gecicifiyat = "";
                adi         = ad[i].Attributes["data-name"].Value;
                adi         = yerineKoy(adi);

                dgwDr.Rows.Add(adi.ToString());

                var fiyati = fiyat[i];
                for (int t = 0; t < fiyati.InnerLength - 3; t++)
                {
                    gecicifiyat += fiyati.InnerText[t];
                }
                dgwDr.Rows[i].Cells[1].Value = gecicifiyat;

                var yazari = yazar[i];
                duzeltme = yerineKoy(yazari.InnerText);
                dgwDr.Rows[i].Cells[2].Value = duzeltme;

                var yayincisi = yayinci[i];
                duzeltme = yerineKoy(yayincisi.InnerText);
                dgwDr.Rows[i].Cells[3].Value = duzeltme;

                dgwDr.Rows[i].Cells[4].Value = rastgele.Next(31, 738);


                var imge = resim[i].Attributes["data-src"].Value;

                tpi = tipi[i].Attributes["data-category"].Value;
                tpi = yerineKoy(tpi);
                dgwDr.Rows[i].Cells[6].Value = tpi.ToString();

                imageİndirNet dmage = new imageİndirNet(imge);
                dmage.Download();
                try
                { dmage.SaveImage("D:\\Resimadi" + i + ".jpg", ImageFormat.Jpeg); }
                catch (Exception)
                {
                    dmage.SaveImage("D:\\Resimadi" + i + ".png", ImageFormat.Png);
                }

                try
                {
                    dgwDr.Rows[i].Cells[7].Value = Image.FromFile("D:\\Resimadi" + i + ".jpg");

                    dgwDr.Rows[i].Cells[5].Value = "D:\\Resimadi" + i + ".jpg";
                }
                catch (Exception)
                {
                    dgwDr.Rows[i].Cells[7].Value = Image.FromFile("D:\\Resimadi" + i + ".png");
                }
            }
            var img = resim[8].Attributes["data-src"].Value;
        }