コード例 #1
0
 private void data_employee() {
   //        String date = lb_date_baptism.getText();
   String name = tf_search.getText();
   if (name.isEmpty()) {
     return;
   }
   String year = "" + dp_year.getYear();
   System.out.println(year);
   if (System.getProperty("version", "resto").equals("resto")) {
     loadData_baptism(S2_customers.ret_guest(name, year));
   } else {
     loadData_baptism(S2_customers.ret_customers(name, year));
   }
 }
コード例 #2
0
  private void do_edit_customer(
      String member_name,
      String address,
      String contact,
      String occupation,
      String income,
      String b_date,
      String civil_status,
      String is_male,
      String num,
      double balance,
      double credit_limit) {

    if (System.getProperty("version", "resto").equals("resto")) {
      S2_customers.edit_guest(
          member_name,
          address,
          contact,
          occupation,
          income,
          b_date,
          civil_status,
          is_male,
          num,
          balance,
          credit_limit);
    } else {
      S2_customers.edit_customer(
          member_name,
          address,
          contact,
          occupation,
          income,
          b_date,
          civil_status,
          is_male,
          num,
          balance,
          credit_limit);
    }

    data_employee();
  }
コード例 #3
0
  private void myInit() {

    //        MyDB.setNames("db_pos_restaurant");
    if (System.getProperty("version", "resto").equals("resto")) {
      ds_title.setText("Customers");
    }
    //           if (System.getProperty("os.name").equalsIgnoreCase("linux")) {
    //
    //            this.setUndecorated(true);
    //        } else {
    ////             JOptionPane.showMessageDialog(null, System.getProperty("os.name"));
    //            this.setUndecorated(false);
    //        }
    tf_search.grabFocus();
    init_long_press();
    init_key();
    init_tbl_baptism();
    //        init_auto_scroll();
    init_tbl_charges();
    hiden(false);
    action_year();
  }
コード例 #4
0
  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);
  }