private void add_customer() { Window p = (Window) this; Dlg_customers nd = Dlg_customers.create(p, true); nd.setTitle(""); // nd.do_pass2(); nd.setCallback( new Dlg_customers.Callback() { @Override public void ok(CloseDialog closeDialog, Dlg_customers.OutputData data) { closeDialog.ok(); add_cust( data.name, data.add, data.contact, data.occupation, data.income, data.bday, data.civil_status, data.gender, data.credit_limit); } @Override public void balance(CloseDialog closeDialog, Dlg_customers.OutputData data) {} }); Center.setCenter(nd); nd.setVisible(true); }
private void edit_customer() { int row = tbl_cust.getSelectedRow(); if (row < 0) { return; } final String num = tbl_cust.getModel().getValueAt(row, 1).toString(); // JOptionPane.showMessageDialog(null, to.b_date); Window p = (Window) this; Dlg_customers nd = Dlg_customers.create(p, true); nd.setTitle(""); if (System.getProperty("version", "resto").equals("resto")) { S2_customers.customers to = S2_customers.get_cust_guest(num); // System.out.println(to.member_name + " asdasd"); nd.do_pass( to.member_name, to.address, to.contact, to.occupation, to.income, to.b_date, to.civil_status, to.is_male, to.balance, num, to.credit_limit); } else { S2_customers.customers to = S2_customers.get_cust_details(num); nd.do_pass( to.member_name, to.address, to.contact, to.occupation, to.income, to.b_date, to.civil_status, to.is_male, to.balance, num, to.credit_limit); } nd.setCallback( new Dlg_customers.Callback() { @Override public void ok(CloseDialog closeDialog, Dlg_customers.OutputData data) { closeDialog.ok(); do_edit_customer( data.name, data.add, data.contact, data.occupation, data.income, data.bday, data.civil_status, data.gender, num, data.balance, data.credit_limit); } @Override public void balance(CloseDialog closeDialog, Dlg_customers.OutputData data) { data_employee(); int row = tbl_cust.getSelectedRow(); if (row < 0) { return; } String num = tbl_cust.getModel().getValueAt(row, 1).toString(); // JOptionPane.showMessageDialog(null, num); loadData_charges(S2_customers.ret_charges(num)); compute_charges(); } }); Center.setCenter(nd); nd.setVisible(true); }