def insert(self): try: session = SessionFactory() session.add(AdminOrm(self.nama, self.email, self.password, self.jenisAkun)) session.commit() session.close() except Exception as e: print("Error -->", e) else: print("Insert Berhasil")
def insertMenuItem(self, ): try: session = SessionFactory() menuItemOrm = MenuItemOrm(self.getNamaItem(), self.getJenisItem(), self.getMerekItem(), self.getHargaItem(), self.getKuantitasItem()) session.add(menuItemOrm) session.commit() session.close() except Exception as e: print("Error -->", e) else: print("Insert Berhasil")
def insertKas(self): try: session = SessionFactory() kasOrm = KasOrm(self.getTglKas(), self.getPemasukan(), self.getPengeluaran(), self.hitungLabaBersih()) session.add(kasOrm) session.commit() session.close() except Exception as e: print("Error -->", e) else: print("Insert Berhasil")
def insertTransaksi(self): try: session = SessionFactory() trsOrm = TransaksiOrm(self.getTanggalTransaksi(), self.getJenisTransaksi(), self.getTotalTransaksi()) session.add(trsOrm) session.commit() session.close() except Exception as e: print("Error -->", e) else: print("Insert Berhasil")