public static int addNullWarranty() { DBWrapper dbw = new DBWrapper(); Db db = dbw.openConnection(); Warranty w = new Warranty(); w.Note = "неопределено"; w.Warr = "нет"; db.insert(w); w = db.from(w).orderByDesc(w.Kodwarr).selectFirst(); return w.Kodwarr; }
public static int addWarranty(String warr) { DBWrapper dbw = new DBWrapper(); Db db = dbw.openConnection(); Warranty w = new Warranty(); if (warr.isEmpty()) { w.Warr = "нет"; } else w.Warr = warr; db.insert(w); w = db.from(w).orderByDesc(w.Kodwarr).selectFirst(); return w.Kodwarr; }
public static void addClient( String phone, String name, String middleName, String passport, String prava, String Surname) { DBWrapper dbw = new DBWrapper(); Db db = dbw.openConnection(); Clients c = new Clients(); c.Mphone = phone; c.Name = name; c.Ochestvo = middleName; c.Passport = passport; c.Prava = prava; c.Surname = Surname; db.insert(c); }
public <T> void insertAll(List<T> list) { for (T t : list) { insert(t); } }