Exemple #1
0
        /// <summary>
        /// Sql'deki verileri muzige yukler
        /// </summary>
        /// <returns>List<urun> tipinde muzikliste dondurur</returns>
        public List <Urun> MuzikYukle()
        {
            List <Urun> muzikliste = new List <Urun>();

            cn.SqlConnetion.Open();
            SqlCommand    command = new SqlCommand("SELECT * FROM MuzikTable", cn.SqlConnetion);
            SqlDataReader reader  = command.ExecuteReader();
            Muzik         muzik;

            while (reader.Read())
            {
                muzik            = new Muzik();
                muzik.urunID     = (int)reader["Muzik_ID"];
                muzik.isim       = (string)reader["Muzik_CDAd"];
                muzik.Sarkici    = (string)reader["Muzik_Sanatci"];
                muzik.kategori   = (string)reader["Muzik_Turu"];
                muzik.ucret      = (double)reader["Muzik_Ucreti"];
                muzik.urunsayisi = (int)reader["Muzik_Stok"];

                try
                {
                    muzik.resim = Image.FromFile(Application.StartupPath + @"\Resources\MuzikResimleri\" + (string)reader["Muzik_Fotograf"]);
                }
                catch (Exception)
                {
                    //dergi.image = Properties.Resources.noimage;
                }

                muzikliste.Add(muzik);
            }
            cn.SqlConnetion.Close();
            return(muzikliste);
        }
Exemple #2
0
 public MuzikTanim(Muzik muzik)
 {
     this.muzik = muzik;
     this.Text  = muzik.isim;
     InitializeComponent();
     lblname.Text          = muzik.isim;
     lblsarkici.Text       = muzik.Sarkici;
     lbltur.Text           = muzik.kategori;
     lblucret.Text         = muzik.ucret.ToString();
     pictureboxmuzik.Image = muzik.resim;
 }
Exemple #3
0
        /// <summary>
        /// Her kitap icin panel olusur.
        /// </summary>
        /// <param name="item">Her item icin ayri ayri muzikpanel calisir.</param>
        /// <param name="sayac2">X kordinatinin kontroludur</param>
        /// <param name="ykontrol">Y kordinatinin kontorludur.</param>
        public MuzikPanel(Muzik item, int sayac2, int ykontrol)
        {
            MusteriLog.kaydet("MuzikPanel");
            this.muzik       = item;
            this.BackColor   = Color.Transparent;
            this.Size        = new Size(290, 200);
            this.BorderStyle = BorderStyle.FixedSingle;
            if (sayac2 % 4 == 0)
            {
                this.Location = new Point(0, ykontrol);
            }
            else
            {
                this.Location = new Point((sayac2 - 1) * 300, ykontrol - 200);
            }
            resimekle                       = new PictureBox();
            resimekle.Size                  = new Size(120, 140);
            resimekle.BackgroundImage       = item.resim;
            resimekle.BackgroundImageLayout = ImageLayout.Zoom;
            this.Controls.Add(resimekle);


            isim           = new Label();
            isim.AutoSize  = true;
            isim.Text      = item.isim;
            isim.TextAlign = ContentAlignment.MiddleLeft;
            isim.Font      = new Font("Microsoft Sans Serif", (float)9.75, FontStyle.Italic);
            this.Controls.Add(isim);

            Sarkici          = new Label();
            Sarkici.AutoSize = true;
            Sarkici.Text     = item.Sarkici;
            Sarkici.Font     = new Font("Microsoft Sans Serif", (float)8.25);
            this.Controls.Add(Sarkici);

            Tur           = new Label();
            Tur.AutoSize  = true;
            Tur.Text      = item.kategori;
            Tur.ForeColor = Color.Black;
            Tur.Font      = new Font("Microsoft Sans Serif", (float)8.50);
            this.Controls.Add(Tur);


            Fiyat          = new Label();
            Fiyat.AutoSize = true;
            Fiyat.Text     = item.ucret + " TL";
            Fiyat.Font     = new Font("Microsoft Sans Serif", (float)11.25, FontStyle.Bold);
            this.Controls.Add(Fiyat);

            detay      = new Button();
            detay.Text = "Detay";
            detay.Size = new Size(80, 30);
            detay.Font = new Font("Microsoft Sans Serif", (float)10.5, FontStyle.Bold);
            this.Controls.Add(detay);

            ekle      = new Button();
            ekle.Text = "Sepete Ekle";
            ekle.Size = new Size(80, 53);
            ekle.Font = new Font("Microsoft Sans Serif", (float)10.5, FontStyle.Bold);
            this.Controls.Add(ekle);


            this.Controls[1].Location = new Point(125, 10);// Name label
            this.Controls[1].BringToFront();

            this.Controls[2].Location = new Point(125, 50);// Singer label
            this.Controls[2].BringToFront();

            this.Controls[3].Location = new Point(125, 30);// Type label
            this.Controls[3].BringToFront();

            this.Controls[4].Location = new Point(125, 110);//  Price1 label
            this.Controls[4].BringToFront();

            this.Controls[0].Location = new Point(180, 100); //Fiyat

            this.Controls[5].Location = new Point(180, 150);

            this.Controls[6].Location = new Point(50, 140);
            ekle.Click += new EventHandler(ekle_Click);

            this.Controls[6].Location = new Point(50, 150);
            detay.Click += new EventHandler(detay_Click);
        }