Coding of Hospital Management Patient Bill Generating System
[Link]
private void btnclickActionPerformed([Link] evt) {
// TODO add your handling code here:
new PASSWORD().setVisible(true);
}
[Link]
private void btndeleteActionPerformed([Link] evt)
{
new deletepatient().setVisible(true);
}
private void btnaddActionPerformed([Link] evt)
{
new addpatient().setVisible(true);
}
private void btnmodifyActionPerformed([Link] evt)
{
new modifypatient().setVisible(true);
}
[Link]
import [Link].*;
import [Link];
private void btnsaveActionPerformed([Link] evt) {
// TODO add your handling code here:
try
{
[Link]("[Link]");
Connection
con=[Link]("jdbc:mysql://localhost:3306/hospitalrec","root","1")
;
String query = "INSERT INTO paitent VALUES (";
query = query + [Link]() + ", ";
query = query + "'" + [Link]() + "', ";
query = query + "'"+[Link]() + "', ";
query = query + "'"+[Link]() + "', ";
query = query + "'"+[Link]() + "', ";
query = query + "'"+[Link]() + "', ";
query = query + [Link]() +", ";
query=query+ [Link]() + ",";
query=query+[Link]() + ",";
query=query+ [Link]()+", ";
query=query+"'"+[Link]()+"',";
query=query+ [Link]()+");";
Statement stmt=[Link]();
[Link](query);
[Link](null,"Saved Successfully");
[Link]();
[Link]();
}
catch(Exception e)
{
[Link](null,"Error in Connectivity");
}
}
private void btnbackActionPerformed([Link] evt) {
new menuscreen().setVisible(true);
}
private void btnnewActionPerformed([Link] evt) {
// TODO add your handling code here:
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
}
[Link]
import [Link].*;
import [Link];
private void btnnew1ActionPerformed([Link] evt) {
// TODO add your handling code here:
try
{ [Link]("[Link]");
Connection con =
[Link]("jdbc:mysql://localhost:3306/hospitalrec","root","1");
Statement stmt =[Link]();
String query = "SELECT * FROM paitent WHERE pno= ";
query = query + [Link]() + ";";
ResultSet rs = [Link](query);
long days1,cfees1,room1,total1,meal1;
String cname1,addr1,phone1,dname1,disease1,type1;
if ([Link]())
{
cname1 = [Link]("pname");
addr1=[Link]("address");
phone1=[Link]("phone");
disease1=[Link]("disease");
dname1=[Link]("dname");
days1=[Link]("nodays");
cfees1=[Link]("cfees");
meal1=[Link]("meal");
room1=[Link]("room");
type1=[Link]("typeroom");
total1=[Link]("total");
[Link](" "+cname1);
[Link](" "+addr1);
[Link](" "+phone1);
[Link](" "+disease1);
[Link](" "+dname1);
[Link](" "+days1);
[Link](" "+cfees1);
[Link](" "+meal1);
[Link](" "+room1);
[Link](" "+type1);
[Link](" "+total1);
}
else
{
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](null, "No such record found");
}
} //end of try
catch(Exception e)
{ [Link](null, "Error in connectivity");
}
}
private void btnsaveActionPerformed([Link] evt) {
// TODO add your handling code here:
int ans;
String query;
ans = [Link](null, "Surely wants to update the record");
if(ans == JOptionPane.YES_OPTION)
{
try
{
[Link]("[Link]");
Connection con =
[Link]("jdbc:mysql://localhost:3306/hospitalrec","root","1");
Statement stmt =[Link]();
query = "UPDATE paitent SET pname = " + "'" + [Link]() + "'";
query = query + ", address = " + "'" + [Link]() + "'";
query=query+", phone = "+ "'"+[Link]()+"',";
query=query+ "disease="+"'" +[Link]()+"',";
query=query+ "dname="+"'"+[Link]()+"',";
query=query+ "nodays="+[Link]()+",";
query=query+ "cfees="+[Link]()+",";
query=query+ "meal="+[Link]()+",";
query=query+"room="+[Link]()+",";
query=query+"typeroom="+"'"+[Link]()+",";
query=query+"total="+[Link]();
query = query + " WHERE pno= " + [Link]() + ";";
[Link](query);
[Link](null, "Record successfully updated");
} //end of try
catch(Exception e)
{ [Link](null, "Error in updation");
}
}//end of if.
}
private void btnnewActionPerformed([Link] evt) {
// TODO add your handling code here:
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
}
private void btnbackActionPerformed([Link] evt) {
new menuscreen().setVisible(true);
}
[Link]
import [Link].*;
import [Link];
private void btnnew1ActionPerformed([Link] evt) {
// TODO add your handling code here:
try {
[Link]("[Link]");
Connection con =
[Link]("jdbc:mysql://localhost:3306/hospitalrec","root","1");
Statement stmt =[Link]();
String query = "SELECT * FROM paitent WHERE pno= ";
query = query + [Link]() + ";";
ResultSet rs = [Link](query);
long days1,cfees1,room1,total1,meal1;
String cname1,addr1,phone1,dname1,disease1,type1;
if ([Link]()) {
cname1 = [Link]("pname");
addr1=[Link]("address");
phone1=[Link]("phone");
disease1=[Link]("disease");
dname1=[Link]("dname");
days1=[Link]("nodays");
cfees1=[Link]("cfees");
meal1=[Link]("meal");
room1=[Link]("room");
type1=[Link]("typeroom");
total1=[Link]("total");
[Link](" "+cname1);
[Link](" "+addr1);
[Link](" "+phone1);
[Link](" "+disease1);
[Link](" "+dname1);
[Link](" "+days1);
[Link](" "+cfees1);
[Link](" "+meal1);
[Link](" "+room1);
[Link](" "+type1);
[Link](" "+total1);
} else {
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](null, "No such record found");
}
} //end of try
catch(Exception e) {
[Link](null, "Error in connectivity");
}
}
private void txttypeFocusLost([Link] evt) {
// TODO add your handling code here:
int a = 0;
String tt;
long tot=0;
tt=[Link]();
if ([Link]("Delux")) {
a=3000;
}
if ([Link]("Twin Bed")) {
a=1800;
}
if ([Link]("Economic")) {
a=1000;
}
[Link](""+a);
tot=[Link]([Link]())*([Link]([Link]())
+[Link]([Link]())+[Link]([Link]()));
[Link](" "+tot);
}
private void btnnewActionPerformed([Link] evt) {
// TODO add your handling code here:
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
[Link](" ");
}
Coding for [Link]
import [Link];
private void btnokActionPerformed([Link] evt)
{
String user1,pass1;
user1=[Link]();
pass1=new String([Link]());
if ([Link]("gurleen") && [Link]("xyz")) {
[Link](null," Correct Password");
new menuscreen().setVisible(true);
} else {
[Link](null," In-Correct Password");
}
}
private void btncancelActionPerformed([Link] evt)
{
[Link](0);
}