package com.wy.query;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import com.sanqing.util.DBConnection;
public class Fees_query extends JFrame {
private GridBagConstraints c;
private Insets inset;
private GridBagLayout gridbag;
private String uptown_name[], uptown_id[], building_id[], room_id[],
date[];
private int indate;
private JButton button3, button4;
private JComboBox uptownbox, buildingbox, roombox, datebox;
private JLabel uptownLabel, buildingLabel, roomLabel, dateLabel;
private String inuptownid, inuptownname, inbuilding, inroom;
private String water, gas, sec, ele, lift, light;
private String waters[], gass[], eles[], lifts[], lights[], dates[],
secs[];
private int k, t;
public Fees_query(int tt) { //根据参数执行不同的方法
t = 0;
if (tt == 1) {
uptowndata();
}
if (tt == 2) {
buildingdata();
}
if (tt == 3) {
roomdata();
}
}
public Fees_query(int tt, String uptown, String uptownname) {
System.out.println("init 2");
String id, name;
t = 0;
id = new String(uptown);
name = new String(uptownname);
if (tt == 1) {
uptowndata(id, name);
}
if (tt == 2) {
buildingdata(id, name);
}
if (tt == 3) { //业主费用查询
roomdata(id, name);
}
}
public Fees_query(int tt, String uptown, String uptownname, String building) {
System.out.println("init 3");
String id1, id2, name;
t = 0;
id1 = new String(uptown);
id2 = new String(building);
name = new String(uptownname);
if (tt == 2) {
buildingdata(id1, id2, name);
}
if (tt == 3) {
roomdata(id1, id2, name);
}
}
public Fees_query(int tt, String uptown, String uptownname,
String building, String room) {
System.out.println("init 4");
String id1, id2, id3, name;
id1 = new String(uptown);
id2 = new String(building);
id3 = new String(room);
name = new String(uptownname);
System.out.println("id3 =" + id3);
roomdata(id1, id2, id3, name);
}
public Fees_query(String id, String name) // 查询小区全部记录
{
super("查询小区");
JLabel titleLabel, dateLabel[], waterLabel[], eleLabel[], secLabel[];
JTextField waterField[], eleField[], secField[];
JButton button1, button2;
int y;
Container panelin = getContentPane();
gridbag = new GridBagLayout();
panelin.setLayout(gridbag);
waters = new String[3];
eles = new String[3];
secs = new String[3];
dates = new String[3];
dateLabel = new JLabel[3];
waterLabel = new JLabel[3];
eleLabel = new JLabel[3];
secLabel = new JLabel[3];
waterField = new JTextField[3];
eleField = new JTextField[3];
secField = new JTextField[3];
try {
Connection connection4 = DBConnection.getConnection(); //
Statement stmt4 = connection4.createStatement();
String sqlLastData = "SELECT tot_water_reading, tot_elec_reading, sec_supply_reading, date FROM district_reading WHERE district_id="
+ id;
ResultSet rsLastData = stmt4.executeQuery(sqlLastData);
k = 0;
while (rsLastData.next()) {
waters[k] = rsLastData.getString("tot_water_reading");
eles[k] = rsLastData.getString("tot_elec_reading");
secs[k] = rsLastData.getString("sec_supply_reading");
dates[k] = rsLastData.getString("date");
k++;
}
rsLastData.close();
connection4.close();
}
catch (Exception ex) {
System.out.println(ex);
}
titleLabel = new JLabel(name + "最近三个月的水,电与供水用电读数");
inset = new Insets(5, 5, 5, 5);
c = new GridBagConstraints(2, 1, 3, 1, 0, 0, 10, 0, inset, 0, 0);
gridbag.setConstraints(titleLabel, c);
panelin.add(titleLabel);
System.out.println(dates[0]);
System.out.println(dates[1]);
System.out.println(dates[2]);
System.out.println(k);
y = 4;
for (int j = 0; j < k; j++) {
dateLabel[j] = new JLabel(dates[j]);
c = new GridBagConstraints(2, y, 1, 1, 0, 0, 10, 0, inset, 0, 0);
gridbag.setConstraints(dateLabel[j], c);
panelin.add(dateLabel[j]);
waterLabel[j] = new JLabel("用水");
c = new GridBagConstraints(4, y, 1, 1, 0, 0, 10, 0, inset, 0, 0);
gridbag.setConstraints(waterLabel[j], c);
panelin.add(waterLabel[j]);
waterField[j] = new JTextField(waters[j], 7);
waterField[j].setEditable(false);
c = new GridBagConstraints(6, y, 1, 1, 0, 0, 10, 0, inset, 0, 0);
gridbag.setConstraints(waterField[j], c);
panelin.add(waterField[j]);
eleLabel[j] = new JLabel("用电");
c = new GridBagConstraints(8, y, 1, 1, 0, 0, 10, 0, inset, 0, 0);
gridbag.setConstraints(eleLabel[j], c);
panelin.add(eleLabel[j]);
eleField[j] = new JTextField(eles[j], 7);
eleField[j].setEditable(false);
c = new GridBagConstraints(10, y, 1, 1, 0, 0, 10, 0, inset, 0, 0);
gridbag.setConstraints(eleField[j], c);
panelin.add(eleField[j]);
secLabel[j] = new JLabel("二次供水用电");
c = new GridBagConstraints(12, y, 1, 1, 0, 0, 10, 0, inset, 0, 0);
gridbag.setConstraints(secLabel[j], c);
panelin.add(secLabel[j]);
secField[j] = new JTextField(secs[j], 7);
secField[j].setEditable(false);
c = new GridBagConstraints(14, y, 1, 1, 0, 0, 10, 0, inset, 0, 0);
gridbag.setConstraints(secField[j], c);
panelin.add(secField[j]);
y += 5;
}
y += 4;
button1 = new JButton("继续查询");
button1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
Fees_query rdif = new Fees_query(1);
Fees_query.this.setVisible(false);
}
});
c = new GridBagConstraints(7, y, 2, 2, 0, 0, 10, 0, inset, 0, 0);
gridbag.setConstraints(button1, c);
panelin.add(button1);
button2 = new JButton("返回");
button2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
Fees_query.this.setVisible(false);
}
});
c = new GridBagConstraints(10, y, 2, 2, 0, 0, 10, 0, inset, 0, 0);
gridbag.setConstraints(button2, c);
panelin.add(button2);
setSize(800, 300);
setVisible(true);
}
public Fees_query(String id, String name, int date)// 查询特定时期小区记录
{
super("查询小区");
// String water, ele, sec;
System.out.println("init 6");
JLabel titleLabel, dateLabel, waterLabel, eleLabel, secLabel;
JTextField waterField, eleField, secField;
JButton button1, button2;
Container panelin = getContentPane();
gridbag = new GridBagLayout();
panelin.setLayout(gridbag);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url4 = "jdbc:odbc:estate";
Connection connection4 = DriverManager.getConnection(url4);
Statement stmt4 = connection4.createStatement();
String sqlLastData = "SELECT tot_water_reading, tot_elec_reading, sec_supply_reading FROM district_reading WHERE district_id="
+ id + "AND date=" + date;
ResultSet rsLastData = stmt4.executeQuery(sqlLastData);
while (rsLastData.next()) {
water = rsLastData.getString("tot_water_reading");
ele = rsLastData.getString("tot_elec_reading");
sec = rsLastData.getString("sec_supply_reading");
}
rsLastData.close();
connection4.close();
}
catch (Exception ex) {
System.out.println(ex);
}
titleLabel = new JLabel(name + "在" + date + "的水,电和二次供水用电读数");
inset = new Insets(5, 5, 5, 5);
c = new GridBagConstraints(2, 1, 3, 1, 0, 0, 1
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
java物业管理系统 (151个子文件)
Fees_query.class 34KB
MonthDataInput.class 13KB
MasterInfo.class 12KB
Building_info.class 12KB
PublicDataInputFrame.class 11KB
Community_info.class 9KB
MonthDataOperate.class 8KB
PublicMonthDataOperate.class 7KB
MonthDataInputBuilding.class 7KB
ChargeReport.class 7KB
PriceChange.class 6KB
MonthDataInputBuilding$2.class 6KB
MonthDataInputBuilding$1.class 5KB
Community_query_room.class 5KB
Community_Master.class 5KB
Community_query.class 5KB
Community_allMaster.class 4KB
Login.class 4KB
DBConnection.class 4KB
Community_Main.class 4KB
Main.class 3KB
Community_Main$SelectDistrict.class 3KB
Login$LoginCheck.class 3KB
MonthDataInputBuilding$1$1.class 3KB
MonthDataInputBuilding$2$2.class 3KB
PublicDataInputFrame$4.class 3KB
MonthDataInputBuilding$2$1.class 3KB
Payment.class 3KB
MonthDataInput$7.class 2KB
Business.class 2KB
Fees_query$36.class 2KB
Fees_query$40.class 2KB
Fees_query$29.class 2KB
Community_info$6.class 2KB
Building_info$7.class 2KB
ChargeReport$1.class 2KB
Fees_query$38.class 2KB
MasterInfo$7.class 2KB
Fees_query$24.class 2KB
Fees_query$34.class 2KB
Fees_query$21.class 2KB
Fees_query$31.class 2KB
Fees_query$39.class 2KB
Fees_query$19.class 2KB
Fees_query$25.class 2KB
Fees_query$15.class 2KB
Fees_query$35.class 2KB
Fees_query$22.class 2KB
Fees_query$32.class 2KB
MonthDataInput$5.class 2KB
Fees_query$13.class 1KB
MonthDataInput$1.class 1KB
MonthDataInput$3.class 1KB
Community_Main$SelectDistrict$1.class 1KB
Fees_query$42.class 1KB
PublicDataInputFrame$1.class 1KB
PublicDataInputFrame$2.class 1KB
Fees_query$41.class 1KB
Fees_query$26.class 1KB
Fees_query$27.class 1KB
Fees_query$16.class 1KB
Fees_query$17.class 1KB
MonthDataInput$4.class 1KB
MonthDataInputBuilding$1$2.class 923B
MonthDataInputBuilding$2$3.class 923B
nowdate.class 871B
Fees_query$11.class 838B
Fees_query$9.class 835B
PublicDataInputFrame$5.class 807B
MonthDataInput$8.class 803B
Fees_query$43.class 801B
Fees_query$3.class 800B
Fees_query$1.class 799B
Fees_query$12.class 791B
Fees_query$10.class 790B
Fees_query$28.class 787B
MonthDataInput$6.class 786B
Fees_query$37.class 783B
Fees_query$7.class 776B
Fees_query$5.class 775B
PublicDataInputFrame$3.class 772B
Fees_query$8.class 771B
Fees_query$6.class 770B
Fees_query$23.class 769B
Fees_query$18.class 767B
Fees_query$33.class 765B
Fees_query$4.class 753B
Fees_query$2.class 752B
MonthDataInput$2.class 750B
Community_info$2.class 745B
Community_info$5.class 745B
Community_info$3.class 745B
Community_info$4.class 744B
Community_info$1.class 742B
Main$8.class 742B
Building_info$6.class 739B
Building_info$4.class 739B
Building_info$3.class 739B
Building_info$1.class 739B
Building_info$5.class 738B
共 151 条
- 1
- 2
资源评论
- MMMMango2020-05-08资源还不错
yf987781516
- 粉丝: 11
- 资源: 31
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功