src/MainWindow.cpp

changeset 485
83b5c2b3c414
parent 481
8a25dbe682eb
child 493
520306773450
--- a/src/MainWindow.cpp	Thu Feb 02 15:50:15 2023 +0100
+++ b/src/MainWindow.cpp	Thu Feb 02 17:14:28 2023 +0100
@@ -164,7 +164,7 @@
  */
 void MainWindow::updateDataBase()
 {
-    QSqlQuery query1, query2, query3, query4;
+    QSqlQuery query1, query2, query4;
     int	count = 0;
     bool added_packs = false;
 
@@ -204,20 +204,12 @@
 	    if (! query2.first()) {
 	    	qDebug() << "  add yeastpack" << query1.value("laboratory").toString() << query1.value("form").toInt();
 
-	    	query3.prepare("SELECT record,cells FROM inventory_yeasts WHERE laboratory=:laboratory AND form=:form");
-	    	query3.bindValue(":laboratory", query1.value("laboratory").toString());
-            	query3.bindValue(":form", query1.value("form").toInt());
-	    	query3.exec();
-	    	query3.first();
-	    	/* Should succeed */
-
 	    	query4.prepare("INSERT INTO inventory_yeastpack SET uuid=:uuid, laboratory=:laboratory, "
-			   "form=:form, package=:package, cells=:cells, viability=:viability, max=:max");
+			   "form=:form, package=:package, viability=:viability, max=:max");
 	    	query4.bindValue(":uuid", QUuid::createUuid().toString().mid(1, 36));
 	    	query4.bindValue(":laboratory", query1.value("laboratory").toString());
 	    	query4.bindValue(":form", query1.value("form").toInt());
 	    	query4.bindValue(":package", g_yeast_forms[query1.value("form").toInt()]);
-	    	query4.bindValue(":cells", query3.value("cells").toDouble());
 		switch (query1.value("form").toInt()) {
 		    case YEAST_FORMS_LIQUID:	query4.bindValue(":viability", 0.80);
 						query4.bindValue(":max", 97);

mercurial