Ejemplo n.º 1
0
 public void EditSoftware(SoftwareItem softwareItem)
 {
     using (SQLiteCommand com = new SQLiteCommand(con))
     {
         com.CommandText = "UPDATE software_items SET itemID = '" + softwareItem.itemID + "', itemName = '" + softwareItem.itemName + "', price = '" + softwareItem.price + "', licensekey = '" + softwareItem.Licensekey + "', sizeinMB = '" + softwareItem.SizeInMB + "' WHERE itemID = '" + softwareItem.itemID + "' ;";
         com.ExecuteNonQuery();
     }
 }
Ejemplo n.º 2
0
        public void SaveSofwareItem(SoftwareItem softwareitemToSave)
        {
            using (SQLiteCommand com = new SQLiteCommand(con))
            {
                com.CommandText = "INSERT INTO software_items (itemID, itemName, price, licensekey, sizeinMB) VALUES ('" + softwareitemToSave.itemID + "','" + softwareitemToSave.itemName + "', '" + softwareitemToSave.price + "', '" + softwareitemToSave.Licensekey + "', '" + softwareitemToSave.SizeInMB + "')";

                com.ExecuteNonQuery();
                com.Dispose();
            }
        }
Ejemplo n.º 3
0
        public void DeleteSoftwareItem(SoftwareItem softwareItemToDelete)
        {
            itemsBaza db1 = new itemsBaza();

            db1.ReadItems();

            using (SQLiteCommand com = new SQLiteCommand(con))
            {
                com.CommandText = "DELETE FROM software_items WHERE (itemID ='" + softwareItemToDelete.itemID + "');";

                com.ExecuteNonQuery();
                com.Dispose();
            }
        }
Ejemplo n.º 4
0
        public List <SoftwareItem> ReadItemsS()
        {
            List <SoftwareItem> seznam = new List <SoftwareItem>();

            using (SQLiteCommand com = new SQLiteCommand(con))
            {
                com.CommandText = "SELECT * FROM software_items";
                SQLiteDataReader reader = com.ExecuteReader();
                while (reader.Read())
                {
                    SoftwareItem Item = new SoftwareItem(Convert.ToString(reader.GetInt32(1)), reader.GetString(2), reader.GetDouble(3), reader.GetString(4), reader.GetInt32(5));
                    seznam.Add(Item);
                }
            }
            return(seznam);
        }