Esempio n. 1
0
        public bool readLootCrateID(ENLootCrate loot)
        {
            bool ok = true;


            SqlConnection conection = new SqlConnection(constring);

            try
            {
                conection.Open();

                using (SqlCommand cmd = new SqlCommand("", conection))
                {
                    cmd.CommandText = "SELECT * FROM Lootcrates where cod = '" + loot.id + "';";

                    SqlDataReader lootcrateRead = cmd.ExecuteReader();

                    while (lootcrateRead.Read())
                    {
                        loot.nameLootCrate        = Convert.ToString(lootcrateRead[1]);
                        loot.price                = float.Parse(Convert.ToString(lootcrateRead[2]));
                        loot.descriptionLootCrate = Convert.ToString(lootcrateRead[3]);
                        loot.url  = Convert.ToString(lootcrateRead[4]);
                        loot.type = Convert.ToString(lootcrateRead[5]);
                    }

                    lootcrateRead.Close();
                }
            }
            catch (SqlException Ex)
            {
                Console.WriteLine("No se ha podido recuperar el producto de la base de datos.", Ex.Message);
                ok = false;
            }
            finally
            {
                conection.Close();
            }

            return(ok);
        }
Esempio n. 2
0
 public bool createLootCrate(ENLootCrate loot)
 {
     return(true);
 }
Esempio n. 3
0
        public bool deleteLootCrate(ENLootCrate loot)
        {
            bool ok = true;

            return(ok);
        }