Beispiel #1
0
        public async Task InsertNewProductAsync(Product productInfo, ExtraInfo extraInfo, User user)
        {
            string ProductName = productInfo.naam.Replace(' ', '_');
            var    commandStr  = $"CREATE TABLE {ProductName}(ID INT(6) AUTO_INCREMENT PRIMARY KEY,Aantal INT(30) NOT NULL,Gewicht DOUBLE NOT NULL,Datum_ontvangen text NOT NULL, Uiterste_datum text NOT NULL, Type text NOT NULL, Leverancier text NOT NULL)";
            string Statement   = $"INSERT INTO {ProductName}(Aantal, Gewicht, Datum_ontvangen, Uiterste_datum, Type, Leverancier) VALUES('{productInfo.aantal}', '{productInfo.Gewicht}', '{productInfo.Datum_Ontvangen}', '{productInfo.Uiterste_Datum}', '{extraInfo.Type}', '{extraInfo.Leverancier}')";

            await dataAccess.SendSaveQueryAsync(commandStr, user);

            await dataAccess.SendSaveQueryAsync(Statement, user);
        }
Beispiel #2
0
 public async Task InsertNewOrderAsync(Product productInfo, ExtraInfo extraInfo, User user)
 {
     string ProductName = productInfo.naam.Replace(' ', '_');
     string Statement   = $"INSERT INTO {ProductName}(Aantal, Gewicht, Datum_ontvangen, Uiterste_datum, Type, Leverancier) VALUES('{productInfo.aantal}', '{productInfo.Gewicht}', '{productInfo.Datum_Ontvangen}', '{productInfo.Uiterste_Datum}', '{extraInfo.Type}', '{extraInfo.Leverancier}')";
     await dataAccess.SendSaveQueryAsync(Statement, user);
 }