SlideShare a Scribd company logo
DiTec Esoft C# Project Free
DiTec Project Esoft (C#)
Cource: Diploma in Information Technology With E commerce
Obtained Grade B For This Project
Do not direct copy form this project. This project was uploaded to enhance your IT
knowledge.I think this project may be very helpful to understand procedure of C# project
for DiTEC.
Welcome Start & Window
Enter Button
private void BtnEnter_Click(object sender, EventArgs e)
{
FrmWelcome fr = new FrmWelcome();
fr.Show();
this.Hide();
}
Exit Button
private void BtnExit_Click(object sender, EventArgs e)
{
DialogResult d1;
d1 = MessageBox.Show("Are You Sure Do You Want To Exit
?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (d1.ToString() == "Yes")
{
Application.Exit();
}
}
Welcome & Loading Window
Timer control
private void timer1_Tick(object sender, EventArgs e)
{
if (progressBar1.Value < 100)
{
progressBar1.Value = progressBar1.Value + 2;
}
else
{
timer1.Enabled=false;
FrmUser fr = new FrmUser();
fr.Show();
this.Hide();
}
Timer Properties
Login Window
Submit Button
string username = "kasun";
string password = "8620";
private void button1_Click(object sender, EventArgs e)
{
if (TxtUsername.Text == username && TxtPassword.Text == password)
{
DialogResult m2;
m2 = MessageBox.Show("Thank
You!", "Sucsess",MessageBoxButtons.OK, MessageBoxIcon.Information);
if (m2.ToString() == "OK")
{
MDISystem md1 = new MDISystem();
md1.Show();
this.Hide();
}
}
else
{
DialogResult m2;
m2 = MessageBox.Show("Incorrect Username & Password
","Error!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
if (m2.ToString() == "Retry")
{
TxtUsername.Clear();
TxtPassword.Clear();
TxtUsername.Focus();
Clear Button
TxtUsername.Text = "";
TxtPassword.Text = "";
TxtUsername.Focus();
Exit Button
DialogResult d1;
d1 = MessageBox.Show("Are You Sure Do You Want To Exit
?","Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (d1.ToString() == "Yes")
{
Application.Exit();
}
MDI Window (Inside Menu Bar)
Appointment Details Window
FrmAppoinment_Details frm = new FrmAppoinment_Details();
frm.MdiParent = this;
frm.Show();
Medical Details Window
FrmMedical_Detals frm= new FrmMedical_Detals();
frm.MdiParent = this;
frm.Show();
Patient Details Window
FrmPatient_Details frm = new FrmPatient_Details();
frm.MdiParent = this;
frm.Show();
Doctor Details Window
FrmDoctor frm = new FrmDoctor();
frm.MdiParent = this;
frm.Show();
Medical Packages Window
FrmDoctor frm = new FrmDoctor();
frm.MdiParent = this;
frm.Show();
Help Window
FrmHelp frm = new FrmHelp();
frm.MdiParent = this;
frm.Show();
Author Window
FrmAuthor frm = new FrmAuthor();
frm.MdiParent = this;
frm.Show();
Appointment Details Window
Add Button
string connectionstring,commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring="INSERT INTO app
VALUES('"+CboRef.Text+"','"+txtpatname.Text+"','"+txtcontact.Text+"','"+txtad
dress.Text+"','"+cbogender.Text+"','"+comboBox1.Text+"','"+txtamount.Text+"')
";
MessageBox.Show("OK","Add Data ?",MessageBoxButtons.OK,MessageBoxIcon.Error);
OleDbConnection conn=new OleDbConnection(connectionstring);
OleDbCommand comm=new OleDbCommand(commandstring,conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Click OK","Data Added Successfully",MessageBoxButtons.OK);
conn.Close();
Search Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "SELECT*FROM app WHERE rn='" + CboRef.Text + "'";
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
OleDbDataReader reader=null;
try
{ conn.Open(); }
catch (Exception ex)
{ MessageBox.Show("Completed !"); }
reader = comm.ExecuteReader();
while (reader.Read())
{
txtpatname.Text = reader[1].ToString();
txtcontact.Text = reader[2].ToString();
txtaddress.Text = reader[3].ToString();
cbogender.Text = reader[4].ToString();
comboBox1.Text = reader[5].ToString();
txtamount.Text = reader[6].ToString();
}
reader.Close();
Update Button
String connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "UPDATE app SET rn='" + CboRef.Text +"',pn='" +
txtpatname.Text + "',co='" + txtcontact.Text + "',ad='" + txtaddress.Text
+ "',gn='" + cbogender.Text + "',pt='" + comboBox1.Text + "',am='" +
txtamount.Text + "'";
MessageBox.Show("Are u Sure", "Do You Want Update
?",MessageBoxButtons.OK, MessageBoxIcon.Error);
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Success", "Data Added
Sucsessfully!",MessageBoxButtons.OK, MessageBoxIcon.Error);
conn.Close();
Clear Button
CboRef.Text = "";
txtpatname.Text = "";
txtcontact.Text = "";
txtaddress.Text = "";
cbogender.Text = "";
comboBox1.Text = "";
txtamount.Text = "";
Delete Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "DELETE*FROM app WHERE rn='"+CboRef.Text+ "'";
if (MessageBox.Show("Are You Sure Do You Want Delete This Record
?", "Sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
== DialogResult.No)
{
return;
}
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Record Deleted Successfully");
CboRef.Text = "";
txtpatname.Clear();
txtcontact.Clear();
txtaddress.Clear();
cbogender.Text = "";
comboBox1.Text = "";
txtamount.Clear();
conn.Close();
Exit Button
this.Hide();
Medical Details Window
Add Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "INSERT INTO medical VALUES('" + comboBox1.Text
+ "','" + textBox3.Text + "','" + textBox2.Text +"','" + textBox1.Text
+ "','" + comboBox2.Text + "')";
MessageBox.Show("OK", "Add Data
?", MessageBoxButtons.OK,MessageBoxIcon.Error);
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Click OK", "Data Added
Successfully",MessageBoxButtons.OK);
conn.Close();
Search Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "SELECT*FROM medical WHERE pno='" +
comboBox1.Text + "'";
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
OleDbDataReader reader = null;
try
{ conn.Open(); }
catch (Exception ex)
{ MessageBox.Show("Completed !"); }
reader = comm.ExecuteReader();
while (reader.Read())
{
textBox3.Text = reader[1].ToString();
textBox2.Text = reader[2].ToString();
textBox1.Text = reader[3].ToString();
comboBox2.Text = reader[4].ToString();
}
reader.Close();
Update Button
String connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "UPDATE medical SET pno='" + comboBox1.Text
+ "',pn='" + textBox3.Text + "',q='" + textBox2.Text +"',pp='" +
textBox1.Text + "',de='" + comboBox2.Text + "'";
MessageBox.Show("Are u Sure", "Do You Want Update
?",MessageBoxButtons.OK, MessageBoxIcon.Error);
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Success", "Data Added
Sucsessfully!",MessageBoxButtons.OK, MessageBoxIcon.Error);
conn.Close();
Clear Button
comboBox1.Text = "";
textBox3.Text = "";
textBox2.Text = "";
textBox1.Text = "";
comboBox2.Text = "";
Delete Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "DELETE*FROM medical WHERE pno='" +
comboBox1.Text + "'";
if (MessageBox.Show("Are You Sure Do You Want Delete This Record
?", "Sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
== DialogResult.No)
{
return;
}
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Record Deleted Successfully");
textBox3.Clear();
textBox2.Clear();
textBox1.Clear();
comboBox2.Text = "";
comboBox1.Text = "";
conn.Close();
Exit Button
this.Hide();
Patient Details Window
Add Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "INSERT INTO patient VALUES('" + comboBox1.Text
+ "','" + textBox1.Text + "','" + comboBox2.Text +"','" + textBox2.Text
+ "','" + textBox3.Text + "','" + textBox4.Text + "')";
MessageBox.Show("OK", "Add Data
?",MessageBoxButtons.OK, MessageBoxIcon.Error);
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Click OK", "Data Added
Successfully",MessageBoxButtons.OK);
conn.Close();
Search Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "SELECT*FROM patient WHERE pno='" +
comboBox1.Text + "'";
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
OleDbDataReader reader = null;
try
{ conn.Open(); }
catch (Exception ex)
{ MessageBox.Show("Completed !"); }
reader = comm.ExecuteReader();
while (reader.Read())
{
textBox1.Text = reader[1].ToString();
comboBox2.Text = reader[2].ToString();
textBox2.Text = reader[3].ToString();
textBox3.Text = reader[4].ToString();
textBox4.Text = reader[5].ToString();
}
reader.Close();
Update Button
String connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "UPDATE patient SET pno='" + comboBox1.Text
+ "',pn='" + textBox1.Text + "',db='" + comboBox2.Text + "',bg='" +
textBox2.Text + "',da='" + textBox3.Text + "',dr='" + textBox4.Text + "'";
MessageBox.Show("Are u Sure", "Do You Want Update
?",MessageBoxButtons.OK, MessageBoxIcon.Error);
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Success", "Data Added
Sucsessfully!",MessageBoxButtons.OK, MessageBoxIcon.Error);
conn.Close();
Clear Button
comboBox1.Text = "";
textBox1.Text = "";
comboBox2.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
Delete Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "DELETE*FROM patient WHERE pno='" +
comboBox1.Text + "'";
if (MessageBox.Show("Are You Sure Do You Want Delete This Record
?", "Sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
== DialogResult.No)
{
return;
}
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Record Deleted Successfully");
comboBox1.Text = "";
textBox1.Text = "";
comboBox2.Text = "";
textBox2.Clear();
textBox3.Clear();
textBox4.Text = "";
Exit Button
this.Hide();
Doctor Details Window
Add Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "INSERT INTO patient VALUES('" + comboBox1.Text
+ "','" + textBox1.Text + "','" + comboBox2.Text +"','" + textBox2.Text
+ "','" + textBox3.Text + "','" + textBox4.Text + "')";
MessageBox.Show("OK", "Add Data
?", MessageBoxButtons.OK,MessageBoxIcon.Error);
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Click OK", "Data Added
Successfully",MessageBoxButtons.OK);
conn.Close();
Search Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "SELECT*FROM patient WHERE pno='" +
comboBox1.Text + "'";
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
OleDbDataReader reader = null;
try
{ conn.Open(); }
catch (Exception ex)
{ MessageBox.Show("Completed !"); }
reader = comm.ExecuteReader();
while (reader.Read())
{
textBox1.Text = reader[1].ToString();
comboBox2.Text = reader[2].ToString();
textBox2.Text = reader[3].ToString();
textBox3.Text = reader[4].ToString();
textBox4.Text = reader[5].ToString();
}
reader.Close();
Update Button
String connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "UPDATE patient SET pno='" + comboBox1.Text
+ "',pn='" + textBox1.Text + "',db='" + comboBox2.Text + "',bg='" +
textBox2.Text + "',da='" + textBox3.Text + "',dr='" + textBox4.Text + "'";
MessageBox.Show("Are u Sure", "Do You Want Update
?",MessageBoxButtons.OK, MessageBoxIcon.Error);
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Success", "Data Added
Sucsessfully!",MessageBoxButtons.OK, MessageBoxIcon.Error);
conn.Close();
Exit Button
this.Hide();
Delete Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "DELETE*FROM patient WHERE pno='" +
comboBox1.Text + "'";
if (MessageBox.Show("Are You Sure Do You Want Delete This Record
?", "Sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
== DialogResult.No)
{
return;
}
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Record Deleted Successfully");
comboBox1.Text = "";
textBox1.Text = "";
comboBox2.Text = "";
textBox2.Clear();
textBox3.Clear();
textBox4.Text = "";
Clear Button
comboBox1.Text = "";
textBox1.Text = "";
comboBox2.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
Medical Packages Window
Add Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "INSERT INTO patient VALUES('" + comboBox1.Text
+ "','" + textBox1.Text + "','" + comboBox2.Text +"','" + textBox2.Text
+ "','" + textBox3.Text + "','" + textBox4.Text + "')";
MessageBox.Show("OK", "Add Data
?", MessageBoxButtons.OK,MessageBoxIcon.Error);
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Click OK", "Data Added
Successfully",MessageBoxButtons.OK);
conn.Close();
Search Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "SELECT*FROM patient WHERE pno='" +
comboBox1.Text + "'";
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
OleDbDataReader reader = null;
try
{ conn.Open(); }
catch (Exception ex)
{ MessageBox.Show("Completed !"); }
reader = comm.ExecuteReader();
while (reader.Read())
{
textBox1.Text = reader[1].ToString();
comboBox2.Text = reader[2].ToString();
textBox2.Text = reader[3].ToString();
textBox3.Text = reader[4].ToString();
textBox4.Text = reader[5].ToString();
}
reader.Close();
Update Button
String connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "UPDATE patient SET pno='" + comboBox1.Text
+ "',pn='" + textBox1.Text + "',db='" + comboBox2.Text + "',bg='" +
textBox2.Text + "',da='" + textBox3.Text + "',dr='" + textBox4.Text + "'";
MessageBox.Show("Are u Sure", "Do You Want Update
?",MessageBoxButtons.OK, MessageBoxIcon.Error);
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Success", "Data Added
Sucsessfully!",MessageBoxButtons.OK, MessageBoxIcon.Error);
conn.Close();
Clear Button
comboBox1.Text = "";
textBox1.Text = "";
comboBox2.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
Delete Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "DELETE*FROM patient WHERE pno='" +
comboBox1.Text + "'";
if (MessageBox.Show("Are You Sure Do You Want Delete This Record
?", "Sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
== DialogResult.No)
{
return;
}
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Record Deleted Successfully");
comboBox1.Text = "";
textBox1.Text = "";
comboBox2.Text = "";
textBox2.Clear();
textBox3.Clear();
textBox4.Text = "";
Exit Button
this.Hide();
Help Window
Select Button
string connectionstring, commandstring;
connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:Hosptal Management Systemesoft.mdb";
commandstring = "SELECT*FROM help WHERE se='" + comboBox1.Text
+ "'";
OleDbConnection conn = newOleDbConnection(connectionstring);
OleDbCommand comm = new OleDbCommand(commandstring, conn);
OleDbDataReader reader = null;
try
{ conn.Open(); }
catch (Exception ex)
{ MessageBox.Show("......"); }
reader = comm.ExecuteReader();
while (reader.Read())
{
textBox2.Text = reader[1].ToString();
}
reader.Close();
Exit Button
this.Hide();
Author Window
Exit Button
this.Hide();
Now I think you earned good knowledge about project . Now I hope to give you additional
codes to solve some problems. ( These are additional codes )
privatevoid btnadd_Click(object sender, EventArgs e)
{
string connectionString, commandString;
connectionString
=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:Hospital
SystemHMS.mdb";
commandString = "INSERT INTO Appoinment VALUES ('"+
cborefno.Text + "','" + txtpatname.Text + "','" + txtcontact.Text
+ "','" + txtaddress.Text + "','" + cbogender.Text + "','" +
cboPayment.Text + "','" + txtamount.Text + "')";
OleDbConnection conn = newOleDbConnection(connectionString);
OleDbCommand comm = newOleDbCommand(commandString, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Record Added Succesfully");
cborefno.Items.Add(cborefno.Text);
Clear();
cborefno.Focus();
conn.Close();
}
privatevoid cborefno_SelectedIndexChanged(object sender,EventArgs e
)
{
string connectionString, commandString;
connectionString
=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:Hospital
SystemHMS.mdb";
commandString = "SELECT * FROM Appoinment WHERE
RefNo='" + cborefno.Text + "'";
OleDbConnection conn = newOleDbConnection(connectionString);
OleDbCommand comm = newOleDbCommand(commandString, conn);
OleDbDataReader reader = null;
try
{ conn.Open(); }
catch (Exception ex)
{ MessageBox.Show(ex.Message); }
reader = comm.ExecuteReader();
while (reader.Read())
{
txtpatname.Text = reader[1].ToString();
txtcontact.Text = reader[2].ToString();
txtaddress.Text = reader[3].ToString();
cbogender.Text = reader[4].ToString();
cboPayment.Text = reader[5].ToString();
txtamount.Text = reader[6].ToString(); }
reader.Close();
conn.Close();
}
privatevoid Form1_Load(object sender, EventArgs e)
{
string connectionString, commandString;
connectionString
=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:Hospital
SystemHMS.mdb";
commandString = "SELECT RefNo FROM Appoinment";
OleDbConnection conn = newOleDbConnection(connectionString);
OleDbCommand comm = newOleDbCommand(commandString, conn);
OleDbDataReader reader = null;
try
{
conn.Open();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
reader = comm.ExecuteReader();
while (reader.Read())
{
cborefno.Items.Add(reader[0]);
}
reader.Close();
conn.Close();
}
privatevoid btnupdate_Click(object sender, EventArgs e)
{
string connectionString, commandString;
connectionString
=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:Hospital
SystemHMS.mdb";
commandString = "UPDATE Appoinment SET PatName = '"+
txtpatname.Text + "', Contact = '" + txtcontact.Text + "', Address
= '" + txtaddress.Text + "', Gender = '" + cbogender.Text
+ "',PayType = '" + cboPayment.Text +"',Amount='" + txtamount.Text
+ "' where RefNo = '" + cborefno.Text + "'";
if (MessageBox.Show("Are you sure, you want to Update this
record?", "Sure?", MessageBoxButtons.YesNo) == DialogResult.No)
{
return;
}
OleDbConnection conn = newOleDbConnection(connectionString);
OleDbCommand comm = newOleDbCommand(commandString, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Record Updated Succesfully");
Clear();
cborefno.Focus();
conn.Close();
}
privatevoid btndelete_Click(object sender, EventArgs e)
{
string connectionString, commandString;
connectionString
=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:Hospital
SystemHMS.mdb";
commandString = "DELETE Appoinment.RefNo FROM
Appoinment where Appoinment.RefNo = '" + cborefno.Text + "'";
if (MessageBox.Show("Are you sure, you want to delete this
record?", "Sure?", MessageBoxButtons.YesNo) == DialogResult.No)
{
return;
}
OleDbConnection conn = newOleDbConnection(connectionString);
OleDbCommand comm = newOleDbCommand(commandString, conn);
conn.Open();
comm.ExecuteNonQuery();
MessageBox.Show("Record Deleted Successfully");
conn.Close();
cborefno.Items.Remove(cborefno.Text);
cborefno.Focus();
Clear();
}
privatevoid Clear()
{
cborefno.Text = "";
txtpatname.Clear();
txtcontact.Clear();
txtaddress.Clear();
cbogender.Text = "";
cboPayment.Text = "";
txtamount.Clear();
cborefno.Focus();
}
privatevoid btnclear_Click(object sender, EventArgs e)
{
Clear();
}
privatevoid btnexit_Click(object sender, EventArgs e)
{
this.Hide();
}
********************************
About Me !
********************************
Kasun Madhusanka
Phone:+94770597830
Email:kktmadhusanka@gmail.com
To Make likes me on facebook click below link
https://www.facebook.com/KKTMadhusanka
To make connection with me !
https://www.linkedin.com/in/kktmadhusanka
http://www.slideshare.net/kktmadhusanka
Posted by Kasun Madhusanka at 3:44 PM

More Related Content

What's hot

Soa lab
Soa lab   Soa lab
Ip project visual mobile
Ip project visual mobileIp project visual mobile
The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194
Mahmoud Samir Fayed
 
ES3-2020-07 Testing techniques
ES3-2020-07 Testing techniquesES3-2020-07 Testing techniques
ES3-2020-07 Testing techniques
David Rodenas
 
Golang dot-testing
Golang dot-testingGolang dot-testing
Golang dot-testing
Richárd Kovács
 
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅
재춘 노
 
The secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutThe secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you about
Dror Helper
 
The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181
Mahmoud Samir Fayed
 
Specs2
Specs2Specs2
How to Start Test-Driven Development in Legacy Code
How to Start Test-Driven Development in Legacy CodeHow to Start Test-Driven Development in Legacy Code
How to Start Test-Driven Development in Legacy Code
Daniel Wellman
 
Data structures lab
Data structures labData structures lab
Data structures lab
Ragu Ram
 
JavaExamples
JavaExamplesJavaExamples
JavaExamples
Suman Astani
 
Vaadin 7
Vaadin 7Vaadin 7
Vaadin 7
Joonas Lehtinen
 
Database By Salman Mushtaq
Database By Salman MushtaqDatabase By Salman Mushtaq
Database By Salman MushtaqSalman Mushtaq
 
Csphtp1 05
Csphtp1 05Csphtp1 05
Csphtp1 05
HUST
 

What's hot (18)

Soa lab
Soa lab   Soa lab
Soa lab
 
Ip project visual mobile
Ip project visual mobileIp project visual mobile
Ip project visual mobile
 
Vb file
Vb fileVb file
Vb file
 
The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194The Ring programming language version 1.5.3 book - Part 188 of 194
The Ring programming language version 1.5.3 book - Part 188 of 194
 
ES3-2020-07 Testing techniques
ES3-2020-07 Testing techniquesES3-2020-07 Testing techniques
ES3-2020-07 Testing techniques
 
Golang dot-testing
Golang dot-testingGolang dot-testing
Golang dot-testing
 
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅
드로이드 나이츠 2018: RxJava 적용 팁 및 트러블 슈팅
 
MaintainStaffTable
MaintainStaffTableMaintainStaffTable
MaintainStaffTable
 
The secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutThe secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you about
 
The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181
 
Bienvenida
BienvenidaBienvenida
Bienvenida
 
Specs2
Specs2Specs2
Specs2
 
How to Start Test-Driven Development in Legacy Code
How to Start Test-Driven Development in Legacy CodeHow to Start Test-Driven Development in Legacy Code
How to Start Test-Driven Development in Legacy Code
 
Data structures lab
Data structures labData structures lab
Data structures lab
 
JavaExamples
JavaExamplesJavaExamples
JavaExamples
 
Vaadin 7
Vaadin 7Vaadin 7
Vaadin 7
 
Database By Salman Mushtaq
Database By Salman MushtaqDatabase By Salman Mushtaq
Database By Salman Mushtaq
 
Csphtp1 05
Csphtp1 05Csphtp1 05
Csphtp1 05
 

Similar to Ditec esoft C# project

CRUD VB2010
CRUD VB2010CRUD VB2010
CRUD VB2010
Achmad Sidik
 
Inventory management
Inventory managementInventory management
Inventory managementRajeev Sharan
 
Membuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhanaMembuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhana
Yusman Kurniadi
 
please code in c#- please note that im a complete beginner- northwind.docx
please code in c#- please note that im a complete beginner-  northwind.docxplease code in c#- please note that im a complete beginner-  northwind.docx
please code in c#- please note that im a complete beginner- northwind.docx
AustinaGRPaigey
 
New text document
New text documentNew text document
New text document
Tam Ngo
 
Tutorial 6.docx
Tutorial 6.docxTutorial 6.docx
Tutorial 6.docx
KrishnaAntala
 
in order to save data from access database and search from it in c# .pdf
in order to save data from access database and search from it in c# .pdfin order to save data from access database and search from it in c# .pdf
in order to save data from access database and search from it in c# .pdf
kalerottnerheissst52
 
C# Program. Create a Windows application that has the functionality .pdf
C# Program. Create a Windows application that has the functionality .pdfC# Program. Create a Windows application that has the functionality .pdf
C# Program. Create a Windows application that has the functionality .pdf
fathimalinks
 
The Ring programming language version 1.9 book - Part 18 of 210
The Ring programming language version 1.9 book - Part 18 of 210The Ring programming language version 1.9 book - Part 18 of 210
The Ring programming language version 1.9 book - Part 18 of 210
Mahmoud Samir Fayed
 
Vb database connections
Vb database connectionsVb database connections
Vb database connections
Tharsikan
 
The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88
Mahmoud Samir Fayed
 
Advanced Java - Practical File
Advanced Java - Practical FileAdvanced Java - Practical File
Advanced Java - Practical File
Fahad Shaikh
 
The Ring programming language version 1.3 book - Part 5 of 88
The Ring programming language version 1.3 book - Part 5 of 88The Ring programming language version 1.3 book - Part 5 of 88
The Ring programming language version 1.3 book - Part 5 of 88
Mahmoud Samir Fayed
 

Similar to Ditec esoft C# project (20)

Quanlycanbo
QuanlycanboQuanlycanbo
Quanlycanbo
 
CRUD VB2010
CRUD VB2010CRUD VB2010
CRUD VB2010
 
Inventory management
Inventory managementInventory management
Inventory management
 
syed
syedsyed
syed
 
Membuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhanaMembuat aplikasi penjualan buku sederhana
Membuat aplikasi penjualan buku sederhana
 
please code in c#- please note that im a complete beginner- northwind.docx
please code in c#- please note that im a complete beginner-  northwind.docxplease code in c#- please note that im a complete beginner-  northwind.docx
please code in c#- please note that im a complete beginner- northwind.docx
 
New text document
New text documentNew text document
New text document
 
Hems
HemsHems
Hems
 
Database connectivity with data reader by varun tiwari
Database connectivity with data reader by varun tiwariDatabase connectivity with data reader by varun tiwari
Database connectivity with data reader by varun tiwari
 
Tutorial 6.docx
Tutorial 6.docxTutorial 6.docx
Tutorial 6.docx
 
Q
QQ
Q
 
in order to save data from access database and search from it in c# .pdf
in order to save data from access database and search from it in c# .pdfin order to save data from access database and search from it in c# .pdf
in order to save data from access database and search from it in c# .pdf
 
Insertarbotones en c
Insertarbotones en cInsertarbotones en c
Insertarbotones en c
 
C#
C#C#
C#
 
C# Program. Create a Windows application that has the functionality .pdf
C# Program. Create a Windows application that has the functionality .pdfC# Program. Create a Windows application that has the functionality .pdf
C# Program. Create a Windows application that has the functionality .pdf
 
The Ring programming language version 1.9 book - Part 18 of 210
The Ring programming language version 1.9 book - Part 18 of 210The Ring programming language version 1.9 book - Part 18 of 210
The Ring programming language version 1.9 book - Part 18 of 210
 
Vb database connections
Vb database connectionsVb database connections
Vb database connections
 
The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88
 
Advanced Java - Practical File
Advanced Java - Practical FileAdvanced Java - Practical File
Advanced Java - Practical File
 
The Ring programming language version 1.3 book - Part 5 of 88
The Ring programming language version 1.3 book - Part 5 of 88The Ring programming language version 1.3 book - Part 5 of 88
The Ring programming language version 1.3 book - Part 5 of 88
 

Recently uploaded

Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
ShivajiThube2
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 

Recently uploaded (20)

Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 

Ditec esoft C# project

  • 1. DiTec Esoft C# Project Free DiTec Project Esoft (C#) Cource: Diploma in Information Technology With E commerce Obtained Grade B For This Project Do not direct copy form this project. This project was uploaded to enhance your IT knowledge.I think this project may be very helpful to understand procedure of C# project for DiTEC.
  • 2.
  • 3.
  • 4. Welcome Start & Window Enter Button private void BtnEnter_Click(object sender, EventArgs e) { FrmWelcome fr = new FrmWelcome(); fr.Show(); this.Hide();
  • 5. } Exit Button private void BtnExit_Click(object sender, EventArgs e) { DialogResult d1; d1 = MessageBox.Show("Are You Sure Do You Want To Exit ?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (d1.ToString() == "Yes") { Application.Exit(); } } Welcome & Loading Window Timer control private void timer1_Tick(object sender, EventArgs e) { if (progressBar1.Value < 100) { progressBar1.Value = progressBar1.Value + 2; } else { timer1.Enabled=false; FrmUser fr = new FrmUser(); fr.Show(); this.Hide(); } Timer Properties
  • 6. Login Window Submit Button string username = "kasun"; string password = "8620"; private void button1_Click(object sender, EventArgs e) { if (TxtUsername.Text == username && TxtPassword.Text == password) { DialogResult m2; m2 = MessageBox.Show("Thank You!", "Sucsess",MessageBoxButtons.OK, MessageBoxIcon.Information); if (m2.ToString() == "OK") { MDISystem md1 = new MDISystem(); md1.Show(); this.Hide(); } }
  • 7. else { DialogResult m2; m2 = MessageBox.Show("Incorrect Username & Password ","Error!", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error); if (m2.ToString() == "Retry") { TxtUsername.Clear(); TxtPassword.Clear(); TxtUsername.Focus(); Clear Button TxtUsername.Text = ""; TxtPassword.Text = ""; TxtUsername.Focus(); Exit Button DialogResult d1; d1 = MessageBox.Show("Are You Sure Do You Want To Exit ?","Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (d1.ToString() == "Yes") { Application.Exit(); } MDI Window (Inside Menu Bar) Appointment Details Window FrmAppoinment_Details frm = new FrmAppoinment_Details(); frm.MdiParent = this; frm.Show(); Medical Details Window FrmMedical_Detals frm= new FrmMedical_Detals(); frm.MdiParent = this; frm.Show(); Patient Details Window FrmPatient_Details frm = new FrmPatient_Details(); frm.MdiParent = this; frm.Show(); Doctor Details Window
  • 8. FrmDoctor frm = new FrmDoctor(); frm.MdiParent = this; frm.Show(); Medical Packages Window FrmDoctor frm = new FrmDoctor(); frm.MdiParent = this; frm.Show(); Help Window FrmHelp frm = new FrmHelp(); frm.MdiParent = this; frm.Show(); Author Window FrmAuthor frm = new FrmAuthor(); frm.MdiParent = this; frm.Show(); Appointment Details Window Add Button string connectionstring,commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring="INSERT INTO app VALUES('"+CboRef.Text+"','"+txtpatname.Text+"','"+txtcontact.Text+"','"+txtad dress.Text+"','"+cbogender.Text+"','"+comboBox1.Text+"','"+txtamount.Text+"') "; MessageBox.Show("OK","Add Data ?",MessageBoxButtons.OK,MessageBoxIcon.Error); OleDbConnection conn=new OleDbConnection(connectionstring); OleDbCommand comm=new OleDbCommand(commandstring,conn);
  • 9. conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Click OK","Data Added Successfully",MessageBoxButtons.OK); conn.Close(); Search Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "SELECT*FROM app WHERE rn='" + CboRef.Text + "'"; OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); OleDbDataReader reader=null; try { conn.Open(); } catch (Exception ex) { MessageBox.Show("Completed !"); } reader = comm.ExecuteReader(); while (reader.Read()) { txtpatname.Text = reader[1].ToString(); txtcontact.Text = reader[2].ToString(); txtaddress.Text = reader[3].ToString(); cbogender.Text = reader[4].ToString(); comboBox1.Text = reader[5].ToString(); txtamount.Text = reader[6].ToString(); } reader.Close(); Update Button String connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "UPDATE app SET rn='" + CboRef.Text +"',pn='" + txtpatname.Text + "',co='" + txtcontact.Text + "',ad='" + txtaddress.Text + "',gn='" + cbogender.Text + "',pt='" + comboBox1.Text + "',am='" + txtamount.Text + "'"; MessageBox.Show("Are u Sure", "Do You Want Update ?",MessageBoxButtons.OK, MessageBoxIcon.Error); OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Success", "Data Added Sucsessfully!",MessageBoxButtons.OK, MessageBoxIcon.Error); conn.Close(); Clear Button CboRef.Text = ""; txtpatname.Text = "";
  • 10. txtcontact.Text = ""; txtaddress.Text = ""; cbogender.Text = ""; comboBox1.Text = ""; txtamount.Text = ""; Delete Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "DELETE*FROM app WHERE rn='"+CboRef.Text+ "'"; if (MessageBox.Show("Are You Sure Do You Want Delete This Record ?", "Sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Record Deleted Successfully"); CboRef.Text = ""; txtpatname.Clear(); txtcontact.Clear(); txtaddress.Clear(); cbogender.Text = ""; comboBox1.Text = ""; txtamount.Clear(); conn.Close(); Exit Button this.Hide(); Medical Details Window
  • 11. Add Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "INSERT INTO medical VALUES('" + comboBox1.Text + "','" + textBox3.Text + "','" + textBox2.Text +"','" + textBox1.Text + "','" + comboBox2.Text + "')"; MessageBox.Show("OK", "Add Data ?", MessageBoxButtons.OK,MessageBoxIcon.Error); OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Click OK", "Data Added Successfully",MessageBoxButtons.OK); conn.Close(); Search Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "SELECT*FROM medical WHERE pno='" + comboBox1.Text + "'"; OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); OleDbDataReader reader = null; try { conn.Open(); } catch (Exception ex) { MessageBox.Show("Completed !"); } reader = comm.ExecuteReader();
  • 12. while (reader.Read()) { textBox3.Text = reader[1].ToString(); textBox2.Text = reader[2].ToString(); textBox1.Text = reader[3].ToString(); comboBox2.Text = reader[4].ToString(); } reader.Close(); Update Button String connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "UPDATE medical SET pno='" + comboBox1.Text + "',pn='" + textBox3.Text + "',q='" + textBox2.Text +"',pp='" + textBox1.Text + "',de='" + comboBox2.Text + "'"; MessageBox.Show("Are u Sure", "Do You Want Update ?",MessageBoxButtons.OK, MessageBoxIcon.Error); OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Success", "Data Added Sucsessfully!",MessageBoxButtons.OK, MessageBoxIcon.Error); conn.Close(); Clear Button comboBox1.Text = ""; textBox3.Text = ""; textBox2.Text = ""; textBox1.Text = ""; comboBox2.Text = ""; Delete Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "DELETE*FROM medical WHERE pno='" + comboBox1.Text + "'"; if (MessageBox.Show("Are You Sure Do You Want Delete This Record ?", "Sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open();
  • 13. comm.ExecuteNonQuery(); MessageBox.Show("Record Deleted Successfully"); textBox3.Clear(); textBox2.Clear(); textBox1.Clear(); comboBox2.Text = ""; comboBox1.Text = ""; conn.Close(); Exit Button this.Hide(); Patient Details Window Add Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "INSERT INTO patient VALUES('" + comboBox1.Text + "','" + textBox1.Text + "','" + comboBox2.Text +"','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')"; MessageBox.Show("OK", "Add Data ?",MessageBoxButtons.OK, MessageBoxIcon.Error); OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open();
  • 14. comm.ExecuteNonQuery(); MessageBox.Show("Click OK", "Data Added Successfully",MessageBoxButtons.OK); conn.Close(); Search Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "SELECT*FROM patient WHERE pno='" + comboBox1.Text + "'"; OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); OleDbDataReader reader = null; try { conn.Open(); } catch (Exception ex) { MessageBox.Show("Completed !"); } reader = comm.ExecuteReader(); while (reader.Read()) { textBox1.Text = reader[1].ToString(); comboBox2.Text = reader[2].ToString(); textBox2.Text = reader[3].ToString(); textBox3.Text = reader[4].ToString(); textBox4.Text = reader[5].ToString(); } reader.Close(); Update Button String connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "UPDATE patient SET pno='" + comboBox1.Text + "',pn='" + textBox1.Text + "',db='" + comboBox2.Text + "',bg='" + textBox2.Text + "',da='" + textBox3.Text + "',dr='" + textBox4.Text + "'"; MessageBox.Show("Are u Sure", "Do You Want Update ?",MessageBoxButtons.OK, MessageBoxIcon.Error); OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Success", "Data Added Sucsessfully!",MessageBoxButtons.OK, MessageBoxIcon.Error); conn.Close(); Clear Button comboBox1.Text = ""; textBox1.Text = ""; comboBox2.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = "";
  • 15. Delete Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "DELETE*FROM patient WHERE pno='" + comboBox1.Text + "'"; if (MessageBox.Show("Are You Sure Do You Want Delete This Record ?", "Sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Record Deleted Successfully"); comboBox1.Text = ""; textBox1.Text = ""; comboBox2.Text = ""; textBox2.Clear(); textBox3.Clear(); textBox4.Text = ""; Exit Button this.Hide(); Doctor Details Window
  • 16. Add Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "INSERT INTO patient VALUES('" + comboBox1.Text + "','" + textBox1.Text + "','" + comboBox2.Text +"','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')"; MessageBox.Show("OK", "Add Data ?", MessageBoxButtons.OK,MessageBoxIcon.Error); OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Click OK", "Data Added Successfully",MessageBoxButtons.OK); conn.Close(); Search Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "SELECT*FROM patient WHERE pno='" + comboBox1.Text + "'"; OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); OleDbDataReader reader = null; try { conn.Open(); } catch (Exception ex) { MessageBox.Show("Completed !"); } reader = comm.ExecuteReader(); while (reader.Read()) { textBox1.Text = reader[1].ToString(); comboBox2.Text = reader[2].ToString(); textBox2.Text = reader[3].ToString(); textBox3.Text = reader[4].ToString(); textBox4.Text = reader[5].ToString(); } reader.Close(); Update Button String connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb";
  • 17. commandstring = "UPDATE patient SET pno='" + comboBox1.Text + "',pn='" + textBox1.Text + "',db='" + comboBox2.Text + "',bg='" + textBox2.Text + "',da='" + textBox3.Text + "',dr='" + textBox4.Text + "'"; MessageBox.Show("Are u Sure", "Do You Want Update ?",MessageBoxButtons.OK, MessageBoxIcon.Error); OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Success", "Data Added Sucsessfully!",MessageBoxButtons.OK, MessageBoxIcon.Error); conn.Close(); Exit Button this.Hide(); Delete Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "DELETE*FROM patient WHERE pno='" + comboBox1.Text + "'"; if (MessageBox.Show("Are You Sure Do You Want Delete This Record ?", "Sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Record Deleted Successfully"); comboBox1.Text = ""; textBox1.Text = ""; comboBox2.Text = ""; textBox2.Clear(); textBox3.Clear(); textBox4.Text = ""; Clear Button comboBox1.Text = ""; textBox1.Text = ""; comboBox2.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; Medical Packages Window
  • 18. Add Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "INSERT INTO patient VALUES('" + comboBox1.Text + "','" + textBox1.Text + "','" + comboBox2.Text +"','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')"; MessageBox.Show("OK", "Add Data ?", MessageBoxButtons.OK,MessageBoxIcon.Error); OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Click OK", "Data Added Successfully",MessageBoxButtons.OK); conn.Close(); Search Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "SELECT*FROM patient WHERE pno='" + comboBox1.Text + "'"; OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); OleDbDataReader reader = null; try { conn.Open(); } catch (Exception ex) { MessageBox.Show("Completed !"); }
  • 19. reader = comm.ExecuteReader(); while (reader.Read()) { textBox1.Text = reader[1].ToString(); comboBox2.Text = reader[2].ToString(); textBox2.Text = reader[3].ToString(); textBox3.Text = reader[4].ToString(); textBox4.Text = reader[5].ToString(); } reader.Close(); Update Button String connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "UPDATE patient SET pno='" + comboBox1.Text + "',pn='" + textBox1.Text + "',db='" + comboBox2.Text + "',bg='" + textBox2.Text + "',da='" + textBox3.Text + "',dr='" + textBox4.Text + "'"; MessageBox.Show("Are u Sure", "Do You Want Update ?",MessageBoxButtons.OK, MessageBoxIcon.Error); OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Success", "Data Added Sucsessfully!",MessageBoxButtons.OK, MessageBoxIcon.Error); conn.Close(); Clear Button comboBox1.Text = ""; textBox1.Text = ""; comboBox2.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; Delete Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "DELETE*FROM patient WHERE pno='" + comboBox1.Text + "'"; if (MessageBox.Show("Are You Sure Do You Want Delete This Record ?", "Sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { return; } OleDbConnection conn = newOleDbConnection(connectionstring);
  • 20. OleDbCommand comm = new OleDbCommand(commandstring, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Record Deleted Successfully"); comboBox1.Text = ""; textBox1.Text = ""; comboBox2.Text = ""; textBox2.Clear(); textBox3.Clear(); textBox4.Text = ""; Exit Button this.Hide(); Help Window Select Button string connectionstring, commandstring; connectionstring =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Hosptal Management Systemesoft.mdb"; commandstring = "SELECT*FROM help WHERE se='" + comboBox1.Text + "'"; OleDbConnection conn = newOleDbConnection(connectionstring); OleDbCommand comm = new OleDbCommand(commandstring, conn); OleDbDataReader reader = null; try { conn.Open(); } catch (Exception ex) { MessageBox.Show("......"); } reader = comm.ExecuteReader();
  • 21. while (reader.Read()) { textBox2.Text = reader[1].ToString(); } reader.Close(); Exit Button this.Hide(); Author Window Exit Button this.Hide(); Now I think you earned good knowledge about project . Now I hope to give you additional codes to solve some problems. ( These are additional codes ) privatevoid btnadd_Click(object sender, EventArgs e) { string connectionString, commandString; connectionString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:Hospital SystemHMS.mdb"; commandString = "INSERT INTO Appoinment VALUES ('"+ cborefno.Text + "','" + txtpatname.Text + "','" + txtcontact.Text
  • 22. + "','" + txtaddress.Text + "','" + cbogender.Text + "','" + cboPayment.Text + "','" + txtamount.Text + "')"; OleDbConnection conn = newOleDbConnection(connectionString); OleDbCommand comm = newOleDbCommand(commandString, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Record Added Succesfully"); cborefno.Items.Add(cborefno.Text); Clear(); cborefno.Focus(); conn.Close(); } privatevoid cborefno_SelectedIndexChanged(object sender,EventArgs e ) { string connectionString, commandString; connectionString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:Hospital SystemHMS.mdb"; commandString = "SELECT * FROM Appoinment WHERE RefNo='" + cborefno.Text + "'"; OleDbConnection conn = newOleDbConnection(connectionString); OleDbCommand comm = newOleDbCommand(commandString, conn); OleDbDataReader reader = null; try { conn.Open(); } catch (Exception ex) { MessageBox.Show(ex.Message); } reader = comm.ExecuteReader(); while (reader.Read()) { txtpatname.Text = reader[1].ToString(); txtcontact.Text = reader[2].ToString(); txtaddress.Text = reader[3].ToString(); cbogender.Text = reader[4].ToString(); cboPayment.Text = reader[5].ToString(); txtamount.Text = reader[6].ToString(); } reader.Close(); conn.Close(); } privatevoid Form1_Load(object sender, EventArgs e) {
  • 23. string connectionString, commandString; connectionString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:Hospital SystemHMS.mdb"; commandString = "SELECT RefNo FROM Appoinment"; OleDbConnection conn = newOleDbConnection(connectionString); OleDbCommand comm = newOleDbCommand(commandString, conn); OleDbDataReader reader = null; try { conn.Open(); } catch (Exception ex) { MessageBox.Show(ex.Message); } reader = comm.ExecuteReader(); while (reader.Read()) { cborefno.Items.Add(reader[0]); } reader.Close(); conn.Close(); } privatevoid btnupdate_Click(object sender, EventArgs e) { string connectionString, commandString; connectionString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:Hospital SystemHMS.mdb"; commandString = "UPDATE Appoinment SET PatName = '"+ txtpatname.Text + "', Contact = '" + txtcontact.Text + "', Address = '" + txtaddress.Text + "', Gender = '" + cbogender.Text + "',PayType = '" + cboPayment.Text +"',Amount='" + txtamount.Text + "' where RefNo = '" + cborefno.Text + "'"; if (MessageBox.Show("Are you sure, you want to Update this record?", "Sure?", MessageBoxButtons.YesNo) == DialogResult.No) { return; } OleDbConnection conn = newOleDbConnection(connectionString); OleDbCommand comm = newOleDbCommand(commandString, conn);
  • 24. conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Record Updated Succesfully"); Clear(); cborefno.Focus(); conn.Close(); } privatevoid btndelete_Click(object sender, EventArgs e) { string connectionString, commandString; connectionString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:Hospital SystemHMS.mdb"; commandString = "DELETE Appoinment.RefNo FROM Appoinment where Appoinment.RefNo = '" + cborefno.Text + "'"; if (MessageBox.Show("Are you sure, you want to delete this record?", "Sure?", MessageBoxButtons.YesNo) == DialogResult.No) { return; } OleDbConnection conn = newOleDbConnection(connectionString); OleDbCommand comm = newOleDbCommand(commandString, conn); conn.Open(); comm.ExecuteNonQuery(); MessageBox.Show("Record Deleted Successfully"); conn.Close(); cborefno.Items.Remove(cborefno.Text); cborefno.Focus(); Clear(); } privatevoid Clear() { cborefno.Text = ""; txtpatname.Clear(); txtcontact.Clear(); txtaddress.Clear(); cbogender.Text = ""; cboPayment.Text = ""; txtamount.Clear(); cborefno.Focus(); } privatevoid btnclear_Click(object sender, EventArgs e)
  • 25. { Clear(); } privatevoid btnexit_Click(object sender, EventArgs e) { this.Hide(); } ******************************** About Me ! ******************************** Kasun Madhusanka Phone:+94770597830 Email:kktmadhusanka@gmail.com To Make likes me on facebook click below link https://www.facebook.com/KKTMadhusanka To make connection with me ! https://www.linkedin.com/in/kktmadhusanka http://www.slideshare.net/kktmadhusanka
  • 26. Posted by Kasun Madhusanka at 3:44 PM