private void saveInformation() { try { global.ActivityDetail = global.con.createStatement(); global.ActivityDetail.executeUpdate( "UPDATE activity SET " + "Description = '" + saveDescriptionFormatting( DescriptionTextBox.getText().toString().replaceAll("'", "''")) + "', " + "Location = '" + LocationTextBox.getText().toString().replaceAll("'", "''") + "' " + "WHERE ActivityID = " + activityID); } catch (SQLException ex) { StringWriter error = new StringWriter(); ex.printStackTrace(new PrintWriter(error)); SystemCrashDialog crash = new SystemCrashDialog( global.root, true, global, global.root.getHeaderRootPanel1().getClientComboBox().getSelectedItem().toString(), global.root.getHeaderRootPanel1().getMatterComboBox().getSelectedItem().toString(), "Err0223", error.toString()); } }
private void loadInformation() { try { global.ActivityDetail = global.con.createStatement(); global.ActivityDetailRS = global.ActivityDetail.executeQuery( "SELECT * FROM activity WHERE ActivityID = " + activityID); global.ActivityDetailRS.first(); descriptionID = global.ActivityDetailRS.getString("Description"); DateTextBox.setText( global.mmddyyyyhmma.format(global.ActivityDetailRS.getTimestamp("DateTime"))); EnteredByTextBox.setText(global.ActivityDetailRS.getString("EnteredBy")); DescriptionTextBox.setText(loadDescriptionFormatting(descriptionID)); CompletedByTextBox.setText(global.ActivityDetailRS.getString("CompletedBy")); HoursTextBox.setText(global.ActivityDetailRS.getString("Hours")); BatesNumberTextBox.setText(global.ActivityDetailRS.getString("BatesNumber")); LocationTextBox.setText(global.ActivityDetailRS.getString("Location")); if (global.ActivityDetailRS.getString("Billable").equals("Y")) { global.billingInfo = global.con.createStatement(); global.billingInfoRS = global.billingInfo.executeQuery( "SELECT billsent FROM billing " + "WHERE ActivityID = " + activityID); global.billingInfoRS.first(); if (global.billingInfoRS.getDate("BillSent") == null) { InvoiceDateTextBox.setText("Not Yet Invoiced"); } else { InvoiceDateTextBox.setText( global.mmddyyyy.format(global.billingInfoRS.getDate("BillSent"))); UpdateButton.setEnabled(false); LocationTextBox.setEnabled(false); LocationTextBox.setBackground(new java.awt.Color(238, 238, 238)); LocationTextBox.setDisabledTextColor(new java.awt.Color(0, 0, 0)); DescriptionTextBox.setEnabled(false); DescriptionTextBox.setBackground(new java.awt.Color(238, 238, 238)); DescriptionTextBox.setDisabledTextColor(new java.awt.Color(0, 0, 0)); } } else { InvoiceDateTextBox.setText("Not Invoiced"); } if (global.ActivityDetailRS.getString("Billable").equals("Y")) { BillableCheckBox.setSelected(true); } else { BillableCheckBox.setSelected(false); } if (global.ActivityDetailRS.getString("File").equals("")) { ViewFileButton.setVisible(false); } else { ViewFileButton.setVisible(true); } if (descriptionID.startsWith("Matter Created") || descriptionID.startsWith("Initial Counsel")) { UpdateButton.setEnabled(false); LocationTextBox.setEnabled(false); LocationTextBox.setBackground(new java.awt.Color(238, 238, 238)); LocationTextBox.setDisabledTextColor(new java.awt.Color(0, 0, 0)); DescriptionTextBox.setEnabled(false); DescriptionTextBox.setBackground(new java.awt.Color(238, 238, 238)); DescriptionTextBox.setDisabledTextColor(new java.awt.Color(0, 0, 0)); } } catch (SQLException ex) { StringWriter error = new StringWriter(); ex.printStackTrace(new PrintWriter(error)); SystemCrashDialog crash = new SystemCrashDialog( global.root, true, global, global.root.getHeaderRootPanel1().getClientComboBox().getSelectedItem().toString(), global.root.getHeaderRootPanel1().getMatterComboBox().getSelectedItem().toString(), "Err0221", error.toString()); } }