private void view() { int id = getSelectId(getJTable()); Payment payment = paymentblservice.getById(id); MainFrame.getLoglabel().setText("查看付款单"); this.textField_paymentId.setText(id + ""); this.comboBox_paymentType.setSelectedItem(payment.getPayment_type()); this.textField_paymentdatetime.setText( DateUtil.getStringByDateTime(payment.getPayment_datetime())); this.textField_paymentamount.setText(payment.getPayment_amount() + ""); this.comboBox_user.setSelectedItem(makeUser(payment.getFinance_user())); }
private void update() { Payment payment = getPayment(); int paymentId = Integer.parseInt(this.textField_paymentId.getText()); payment.setId(paymentId); boolean result = paymentblservice.update(payment); // 重新读取数据 setViewDatas(); // 刷新列表, 清空表单 clear(); // 通知更新结果 if (result) { MainFrame.getLoglabel().setText("更新付款信息成功"); logger.info("更新付款信息成功"); } else { MainFrame.getLoglabel().setText("更新付款信息失败"); logger.error("更新付款信息失败"); } }
private Vector<Vector> changeDatas(Vector<Payment> payments) { Vector<Vector> view = new Vector<Vector>(); for (Payment payment : payments) { Vector v = new Vector(); v.add(payment.getId()); v.add(payment.getPayment_type()); v.add(payment.getPayment_amount()); v.add(DateUtil.getStringByDateTime(payment.getPayment_datetime())); v.add(payment.getFinance_user().getUser_name()); view.add(v); } return view; }