Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 public <T> void insertAll(List<T> list) {
   for (T t : list) {
     insert(t);
   }
 }