Skip to content

Commit 095d1c3

Browse files
committed
Added features and input error messages
Made improvements in the software by adding error messages on wrong input and adding some features
1 parent 8088434 commit 095d1c3

20 files changed

+672
-424
lines changed

software_src/Bill_Page.form

+21
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,27 @@
535535
</Constraint>
536536
</Constraints>
537537
</Component>
538+
<Component class="javax.swing.JTextField" name="jTextField6">
539+
<Constraints>
540+
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
541+
<AbsoluteConstraints x="330" y="350" width="300" height="-1"/>
542+
</Constraint>
543+
</Constraints>
544+
</Component>
545+
<Component class="javax.swing.JTextField" name="jTextField7">
546+
<Constraints>
547+
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
548+
<AbsoluteConstraints x="330" y="390" width="300" height="-1"/>
549+
</Constraint>
550+
</Constraints>
551+
</Component>
552+
<Component class="javax.swing.JTextField" name="jTextField8">
553+
<Constraints>
554+
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
555+
<AbsoluteConstraints x="330" y="430" width="300" height="-1"/>
556+
</Constraint>
557+
</Constraints>
558+
</Component>
538559
<Component class="javax.swing.JLabel" name="jLabel12">
539560
<Properties>
540561
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">

software_src/Bill_Page.java

+48
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,42 @@ public Bill_Page(int ch,String bid) throws SQLException {
4747
jTextField5.setText(""+rs.getInt("Test_Charges"));
4848
if (ch==2)
4949
jButton1.setText("Confirm");
50+
else if (ch==1)
51+
{
52+
try {
53+
Connect.create_Connection();
54+
Connect.sql = "SELECT * FROM bills WHERE Patient_Name='"+ jTextField2.getText() +"';";
55+
rs = Connect.stmt.executeQuery(Connect.sql);
56+
while(rs.next())
57+
{
58+
jTextField3.setText(rs.getString("Doctor_Name"));
59+
jTextField6.setText(rs.getString("Test_Date"));
60+
jTextField7.setText(rs.getString("Collection_Date"));
61+
jTextField1.setEditable(false);
62+
jTextField2.setEditable(false);
63+
jTextField3.setEditable(false);
64+
jTextField4.setEditable(false);
65+
jTextField5.setEditable(false);
66+
jTextField6.setEditable(false);
67+
jTextField7.setEditable(false);
68+
jTextField8.setEditable(false);
69+
jComboBox1.setVisible(false);
70+
jComboBox2.setVisible(false);
71+
jComboBox3.setVisible(false);
72+
jComboBox4.setVisible(false);
73+
jComboBox5.setVisible(false);
74+
jComboBox6.setVisible(false);
75+
jComboBox7.setVisible(false);
76+
jComboBox8.setVisible(false);
77+
jLabel10.setVisible(false);
78+
jTextField8.setVisible(false);
79+
jLabel12.setVisible(false);
80+
jLabel13.setVisible(false);
81+
}
82+
} catch (SQLException ex) {
83+
Logger.getLogger(Patient_home.class.getName()).log(Level.SEVERE, null, ex);
84+
}
85+
}
5086
}
5187

5288
/**
@@ -83,6 +119,9 @@ private void initComponents() {
83119
jComboBox6 = new javax.swing.JComboBox();
84120
jComboBox7 = new javax.swing.JComboBox();
85121
jComboBox8 = new javax.swing.JComboBox();
122+
jTextField6 = new javax.swing.JTextField();
123+
jTextField7 = new javax.swing.JTextField();
124+
jTextField8 = new javax.swing.JTextField();
86125
jLabel12 = new javax.swing.JLabel();
87126
jLabel13 = new javax.swing.JLabel();
88127
jLabel14 = new javax.swing.JLabel();
@@ -226,6 +265,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
226265
jComboBox8.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "00", "10", "20", "30", "40", "50" }));
227266
jPanel1.add(jComboBox8);
228267
jComboBox8.setBounds(440, 430, 41, 22);
268+
jPanel1.add(jTextField6);
269+
jTextField6.setBounds(330, 350, 300, 22);
270+
jPanel1.add(jTextField7);
271+
jTextField7.setBounds(330, 390, 300, 22);
272+
jPanel1.add(jTextField8);
273+
jTextField8.setBounds(330, 430, 300, 22);
229274

230275
jLabel12.setFont(new java.awt.Font("Century Gothic", 1, 14)); // NOI18N
231276
jLabel12.setForeground(new java.awt.Color(255, 255, 255));
@@ -427,5 +472,8 @@ public void run() {
427472
private javax.swing.JTextField jTextField3;
428473
private javax.swing.JTextField jTextField4;
429474
private javax.swing.JTextField jTextField5;
475+
private javax.swing.JTextField jTextField6;
476+
private javax.swing.JTextField jTextField7;
477+
private javax.swing.JTextField jTextField8;
430478
// End of variables declaration//GEN-END:variables
431479
}

software_src/Connect.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
public class Connect {
1212
static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
1313
static final String DB_URL = "jdbc:mysql://127.0.0.1:3306/mymlas";
14-
static final String USER = "ghost";
15-
static final String PASS = "naresh95";
14+
static final String USER = "root";
15+
static final String PASS = "user12";
1616
static String sql = null;
1717
static Connection conn = null;
1818
static Statement stmt = null;

software_src/Date.java

+52-52
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
/*
2-
* To change this license header, choose License Headers in Project Properties.
3-
* To change this template file, choose Tools | Templates
4-
* and open the template in the editor.
5-
*/
6-
package mymlas;
7-
8-
/**
9-
*
10-
* @author ghost_000
11-
*/
12-
public class Date {
13-
private int day_;
14-
private int month_;
15-
private int year_;
16-
17-
public Date(){
18-
day_ = 1;
19-
month_ = 1;
20-
year_ = 2014;
21-
}
22-
23-
public Date(int day,int month,int year){
24-
day_ = day;
25-
month_ = month;
26-
year_ = year;
27-
}
28-
29-
public int get_day() {
30-
return day_;
31-
}
32-
33-
public void set_day(int day) {
34-
day_ = day;
35-
}
36-
37-
public int get_month() {
38-
return month_;
39-
}
40-
41-
public void set_month(int month) {
42-
month_ = month;
43-
}
44-
45-
public int get_year() {
46-
return year_;
47-
}
48-
49-
public void set_year(int year) {
50-
year_ = year;
51-
}
52-
}
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package mymlas;
7+
8+
/**
9+
*
10+
* @author ghost_000
11+
*/
12+
public class Date {
13+
private int day_;
14+
private int month_;
15+
private int year_;
16+
17+
public Date(){
18+
day_ = 1;
19+
month_ = 1;
20+
year_ = 2014;
21+
}
22+
23+
public Date(int day,int month,int year){
24+
day_ = day;
25+
month_ = month;
26+
year_ = year;
27+
}
28+
29+
public int get_day() {
30+
return day_;
31+
}
32+
33+
public void set_day(int day) {
34+
day_ = day;
35+
}
36+
37+
public int get_month() {
38+
return month_;
39+
}
40+
41+
public void set_month(int month) {
42+
month_ = month;
43+
}
44+
45+
public int get_year() {
46+
return year_;
47+
}
48+
49+
public void set_year(int year) {
50+
year_ = year;
51+
}
52+
}

software_src/Home.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,13 @@ private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
289289
} catch (SQLException ex) {
290290
Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);
291291
}
292-
this.setVisible(false);
293-
mhm.setVisible(true);
292+
if (!(jTextField2.getText().equals("management")))
293+
JOptionPane.showMessageDialog(null,"Incorrect Password\n");
294+
else
295+
{
296+
this.setVisible(false);
297+
mhm.setVisible(true);
298+
}
294299
}
295300
else
296301
{

software_src/Management.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public boolean edit_Test(Test prev_Test, Test new_Test) throws SQLException {
109109
return flag1;
110110
}
111111
}
112-
Connect.sql = "UPDATE Tests SET Test_Name = '" + new_Test.get_Testname() + "',Test_Charges = " + new_Test.get_Testcharges() + " WHERE Test_Name = '" + prev_Test.get_Testname() + "' AND Test_Charges = " + prev_Test.get_Testcharges() + ";";
112+
Connect.sql = "UPDATE Tests SET Test_Name = '" + new_Test.get_Testname() + "',Test_Charges = " + new_Test.get_Testcharges() + " , Stocks = '" + new_Test.stockReq + "' WHERE Test_Name = '" + prev_Test.get_Testname() + "' AND Test_Charges = " + prev_Test.get_Testcharges() + ";";
113113
Connect.stmt.executeUpdate(Connect.sql);
114114
JOptionPane.showMessageDialog(null,"Done.\n");
115115
for(int i = 0;i < num_Tests_;i++){

software_src/Management_home.form

+17
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,23 @@
509509
<Property name="useNullLayout" type="boolean" value="true"/>
510510
</Layout>
511511
<SubComponents>
512+
<Component class="javax.swing.JLabel" name="jLabel30">
513+
<Properties>
514+
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
515+
<Font name="Century Gothic" size="36" style="1"/>
516+
</Property>
517+
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
518+
<Color blue="ff" green="ff" red="ff" type="rgb"/>
519+
</Property>
520+
<Property name="horizontalAlignment" type="int" value="0"/>
521+
<Property name="text" type="java.lang.String" value="NO NEW NOTIFICATIONS"/>
522+
</Properties>
523+
<Constraints>
524+
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
525+
<AbsoluteConstraints x="0" y="60" width="960" height="430"/>
526+
</Constraint>
527+
</Constraints>
528+
</Component>
512529
<Component class="javax.swing.JButton" name="jButton1">
513530
<Properties>
514531
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">

software_src/Management_home.java

+30-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ public Management_home() throws SQLException {
3737
jPanel3.setVisible(false);
3838
jPanel4.setVisible(false);
3939
jPanel5.setVisible(false);
40+
jLabel30.setVisible(false);
41+
jButton1.setVisible(true);
42+
jButton2.setVisible(true);
43+
jButton3.setVisible(true);
44+
jLabel27.setVisible(true);
45+
jLabel28.setVisible(true);
46+
jLabel29.setVisible(true);
47+
jLabel11.setVisible(true);
48+
jLabel10.setVisible(true);
4049
try {
4150
Connect.create_Connection();
4251
int cnt=0;
@@ -48,7 +57,18 @@ public Management_home() throws SQLException {
4857
//nserial = rs.getInt("id");
4958
}
5059
if (cnt==0)
51-
jLabel23.setText("0 Notifications");
60+
{
61+
jLabel23.setText("0 Notifications");
62+
jLabel30.setVisible(true);
63+
jButton1.setVisible(false);
64+
jButton2.setVisible(false);
65+
jButton3.setVisible(false);
66+
jLabel27.setVisible(false);
67+
jLabel28.setVisible(false);
68+
jLabel29.setVisible(false);
69+
jLabel11.setVisible(false);
70+
jLabel10.setVisible(false);
71+
}
5272
else
5373
{
5474
jLabel23.setText(""+cnt+" Notifications");
@@ -715,6 +735,7 @@ private void initComponents() {
715735
jLabel14 = new javax.swing.JLabel();
716736
jLabel23 = new javax.swing.JLabel();
717737
jPanel5 = new javax.swing.JPanel();
738+
jLabel30 = new javax.swing.JLabel();
718739
jButton1 = new javax.swing.JButton();
719740
jButton2 = new javax.swing.JButton();
720741
jButton3 = new javax.swing.JButton();
@@ -892,6 +913,13 @@ private void initComponents() {
892913

893914
jPanel5.setLayout(null);
894915

916+
jLabel30.setFont(new java.awt.Font("Century Gothic", 1, 36)); // NOI18N
917+
jLabel30.setForeground(new java.awt.Color(255, 255, 255));
918+
jLabel30.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
919+
jLabel30.setText("NO NEW NOTIFICATIONS");
920+
jPanel5.add(jLabel30);
921+
jLabel30.setBounds(0, 60, 960, 430);
922+
895923
jButton1.setBackground(new java.awt.Color(255, 255, 255));
896924
jButton1.setFont(new java.awt.Font("Century Gothic", 1, 16)); // NOI18N
897925
jButton1.setForeground(new java.awt.Color(255, 255, 255));
@@ -1181,6 +1209,7 @@ public void run() {
11811209
private javax.swing.JLabel jLabel28;
11821210
private javax.swing.JLabel jLabel29;
11831211
private javax.swing.JLabel jLabel3;
1212+
private javax.swing.JLabel jLabel30;
11841213
private javax.swing.JLabel jLabel4;
11851214
private javax.swing.JLabel jLabel5;
11861215
private javax.swing.JLabel jLabel6;

software_src/MyMLAS.java

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
/*
2-
* To change this license header, choose License Headers in Project Properties.
3-
* To change this template file, choose Tools | Templates
4-
* and open the template in the editor.
5-
*/
6-
package mymlas;
7-
8-
/**
9-
*
10-
* @author ghost_000
11-
*/
12-
public class MyMLAS {
13-
14-
/**
15-
* @param args the command line arguments
16-
*/
17-
public static void main(String[] args) {
18-
Home hm = new Home();
19-
hm.setVisible(true);
20-
}
21-
22-
}
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package mymlas;
7+
8+
/**
9+
*
10+
* @author ghost_000
11+
*/
12+
public class MyMLAS {
13+
14+
/**
15+
* @param args the command line arguments
16+
*/
17+
public static void main(String[] args) {
18+
Home hm = new Home();
19+
hm.setVisible(true);
20+
}
21+
22+
}

0 commit comments

Comments
 (0)