Esempio n. 1
0
        public void preiseAktualisieren(SteamGegenstand Artikel, int Shop)
        {
            SQLiteConnection dbConnection = new SQLiteConnection("Data Source = Favoriten.sqlite; Version = 3;");

            dbConnection.Open(); string sql;
            if (Shop == 0)
            {
                sql = "UPDATE Favoritenliste SET SteamPreis = @SteamPreis WHERE Name  = '";
            }
            else
            {
                sql = "UPDATE Favoritenliste SET OPSkinsPreis = @OPSkinsPreis WHERE Name  = '";
            }
            sql += Artikel.Name + "';";
            SQLiteCommand Command = new SQLiteCommand(sql, dbConnection);

            if (Shop == 0)
            {
                Command.Parameters.Add("@SteamPreis", System.Data.DbType.String).Value = Artikel.SteamPreis;
            }
            else
            {
                Command.Parameters.Add("@OPSkinsPreis", System.Data.DbType.String).Value = Artikel.OPSkinsPreis;
            }
            Command.ExecuteNonQuery();
            Command.Parameters.Clear();
            dbConnection.Close();
            laden();
        }
Esempio n. 2
0
        public void loeschen(SteamGegenstand Artikel)
        {
            SQLiteConnection dbConnection = new SQLiteConnection("Data Source = Favoriten.sqlite; Version = 3;");

            dbConnection.Open();
            string        sql     = "DELETE FROM Favoritenliste WHERE Name = '" + Artikel.Name + "';";
            SQLiteCommand Command = new SQLiteCommand(sql, dbConnection);

            Command.ExecuteNonQuery();
            dbConnection.Close();
            laden();
        }
Esempio n. 3
0
        private bool bereitsInDatenbank(SteamGegenstand Artikel)
        {
            bool Ergebnis = false;

            foreach (SteamGegenstand sg in FavoritenListe)
            {
                if (sg.Name == Artikel.Name)
                {
                    Ergebnis = true;
                }
            }
            return(Ergebnis);
        }
        public PanelSuchergebnis(int x, int y, SteamGegenstand a, int panelindex)
        {
            Artikel          = a;
            this.Size        = new Size(700, 120);
            this.Location    = new Point(x, y);
            this.BorderStyle = BorderStyle.Fixed3D;
            //this.BackColor = Color.Red;

            Favorit.Parent   = this;
            Favorit.Location = new Point(500, 60);
            Favorit.Name     = panelindex.ToString();

            fav = new Favoriten();
            if (fav.FavoritenListe.Exists(z => z.Name == Artikel.Name))
            {
                Favorit.Text   = "Favorit entfernen";
                Favorit.Click += favoritenLoeschen_Click;
            }

            else
            {
                Favorit.Text   = "Favorit hinzufügen";
                Favorit.Click += favoritenHinzufuegen_Click;
            }
            Favorit.AutoSize = true;

            Bezeichnung.Parent   = this;
            Bezeichnung.Location = new Point(150, 30);
            Bezeichnung.Text     = Artikel.Name;
            Bezeichnung.AutoSize = true;

            Spiel.Parent   = this;
            Spiel.Location = new Point(150, 90);
            Spiel.Text     = Artikel.Spiel;
            Spiel.AutoSize = true;

            Bild.Parent   = this;
            Bild.Location = new Point(10, 10);
            Bild.Size     = new Size(100, 100);
            Bild.SizeMode = PictureBoxSizeMode.Zoom;
            Bild.Load(Artikel.BildURL);
        }
Esempio n. 5
0
 public void hinzufuegen(SteamGegenstand Artikel)
 {
     if (!bereitsInDatenbank(Artikel))
     {
         SQLiteConnection dbConnection = new SQLiteConnection("Data Source = Favoriten.sqlite; Version = 3;");
         dbConnection.Open();
         string        sql     = "INSERT INTO Favoritenliste(Name, Spiel,SteamURL, BildURL,SteamPreis,OPSkinsPreis) VALUES(@name, @spiel,@SteamURL,@BildURL,@SteamPreis,@OPSkinsPreis)";
         SQLiteCommand Command = new SQLiteCommand(sql, dbConnection);
         Command.Parameters.Add("@name", System.Data.DbType.String).Value         = Artikel.Name;
         Command.Parameters.Add("@spiel", System.Data.DbType.String).Value        = Artikel.Spiel;
         Command.Parameters.Add("@SteamURL", System.Data.DbType.String).Value     = Artikel.SteamURL;
         Command.Parameters.Add("@BildURL", System.Data.DbType.String).Value      = Artikel.BildURL;
         Command.Parameters.Add("@SteamPreis", System.Data.DbType.String).Value   = Artikel.SteamPreis;
         Command.Parameters.Add("@OPSkinsPreis", System.Data.DbType.String).Value = Artikel.OPSkinsPreis;
         Command.ExecuteNonQuery();
         Command.Parameters.Clear();
         dbConnection.Close();
         laden();
     }
 }
        public PanelArtikelseite(SteamGegenstand a, int panelheight)
        {
            Artikel       = a;
            this.Size     = new Size(700, panelheight - 180);
            this.Location = new Point(100, 140);

            Favorit.Parent = this;
            Favorit.Name   = "ButtonFavoritHinzufuegen";
            if (f.FavoritenListe.Exists(x => x.Name == Artikel.Name))
            {
                Favorit.Text   = "Aus Favoriten";
                Favorit.Click += FavoritLoeschen_Click;
            }
            else
            {
                Favorit.Text   = "Zu Favoriten";
                Favorit.Click += FavoritHinzufuegen_Click;
            }
            Favorit.Location = new Point(this.Width - Favorit.Width, 0);
            Favorit.AutoSize = true;

            PreisSteam.Parent   = this;
            PreisSteam.Location = new Point(300, 250);
            PreisSteam.Name     = "PreisSteam";
            Artikel.getSteamPreis();
            PreisSteam.Text     = "$ " + Artikel.SteamPreis.ToString();
            PreisSteam.AutoSize = true;

            string SteamShopLinkString = Artikel.getShopLink(0);

            SteamShopLink.Parent   = this;
            SteamShopLink.Size     = new Size(100, 100);
            SteamShopLink.Image    = Image.FromFile("../../steam-icon.png");
            SteamShopLink.SizeMode = PictureBoxSizeMode.Zoom;
            SteamShopLink.Location = new Point(280, 150);
            //SteamShopLink.Text = Artikel.getShopLink(0).ToString();
            SteamShopLink.Click += steamShopLink_Click;

            PreisOPSkins.Parent   = this;
            PreisOPSkins.Location = new Point(500, 250);
            PreisOPSkins.Name     = "PreisOPSkins";
            Artikel.getOPSkinsPreis();
            PreisOPSkins.Text     = "$ " + Artikel.OPSkinsPreis.ToString();
            PreisOPSkins.AutoSize = true;

            string OPSkinsShopLinkString = Artikel.getShopLink(1);

            OPSkinsShopLink.Parent   = this;
            OPSkinsShopLink.Size     = new Size(100, 100);
            OPSkinsShopLink.Image    = Image.FromFile("../../opskins-icon.png");
            OPSkinsShopLink.SizeMode = PictureBoxSizeMode.Zoom;
            OPSkinsShopLink.Location = new Point(480, 150);

            //OPSkinsShopLink.Text = Artikel.getShopLink(1).ToString();
            OPSkinsShopLink.Click += opskinsShopLink_Click;

            Zurueck.Parent   = this;
            Zurueck.Name     = "ButtonZurueck";
            Zurueck.Text     = "Zurück";
            Zurueck.AutoSize = true;
            Zurueck.Click   += buttonZurueck_Click;
            Zurueck.Location = new Point(this.Width - Zurueck.Width, this.Height - Zurueck.Height);

            Bezeichnung.Parent   = this;
            Bezeichnung.Location = new Point(260, 30);
            Bezeichnung.Text     = Artikel.Name;
            Bezeichnung.AutoSize = true;

            Spiel.Parent   = this;
            Spiel.Location = new Point(260, 90);
            Spiel.Text     = Artikel.Spiel;
            Spiel.AutoSize = true;

            Bild.Parent   = this;
            Bild.Location = new Point(0, 0);
            Bild.Size     = new Size(240, 240);
            Bild.SizeMode = PictureBoxSizeMode.Zoom;
            Bild.Load(Artikel.BildURL);
        }