private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (String.IsNullOrEmpty(textBox1.Text)) { MessageBox.Show("Enter Username"); } else { connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand = new OracleCommand(); thisCommand.Connection = CN.thisConnection; thisCommand.CommandText = "SELECT * FROM HOSPITAL_LOGIN WHERE username='******'"; thisReader = thisCommand.ExecuteReader(); if (thisReader.Read()) { Welcome ob = new Welcome(textBox1.Text); ob.Show(); this.Hide(); } else { MessageBox.Show("No account! contact with Admin."); } } }
public void make_comboBox() { connection sv = new connection(); sv.thisConnection.Open(); string query = "SELECT * FROM patient_data where REFDOCTOR = '" + d_name + "' "; OracleCommand cmddatabase = new OracleCommand(query, sv.thisConnection); OracleDataReader myReader = cmddatabase.ExecuteReader(); try { while (myReader.Read()) { comboBox1.Items.Add(myReader.GetString(myReader.GetOrdinal("p_id"))); } } catch (Exception ex) { MessageBox.Show(ex.Message); } sv.thisConnection.Close(); }
private void compounder_Load(object sender, EventArgs e) { connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand = CN.thisConnection.CreateCommand(); thisCommand.CommandText = "SELECT * FROM doctor_appointment where weight_kg IS NULL and bp is null and pulse_min is null"; OracleDataReader thisReader = thisCommand.ExecuteReader(); while (thisReader.Read()) { ListViewItem lsvItem = new ListViewItem(); lsvItem.Text = thisReader["token_id"].ToString(); listView1.Items.Add(lsvItem); } CN.thisConnection.Close(); }
//'dependent comboboxList private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) { string val = comboBox2.Text.ToString(); connection sv = new connection(); sv.thisConnection.Open(); string query = "SELECT * FROM doctor_data WHERE department = '" + val + "'"; OracleCommand cmddatabase = new OracleCommand(query, sv.thisConnection); OracleDataReader myReader = cmddatabase.ExecuteReader(); try { while (myReader.Read()) { comboBox1.Items.Add(myReader.GetString(myReader.GetOrdinal("doc_name"))); } } catch (Exception ex) { MessageBox.Show(ex.Message); } sv.thisConnection.Close(); }
private void ward_Load(object sender, EventArgs e) { connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand = CN.thisConnection.CreateCommand(); thisCommand.CommandText = "SELECT * FROM ward_allocation"; OracleDataReader thisReader = thisCommand.ExecuteReader(); while (thisReader.Read()) { ListViewItem lsvItem = new ListViewItem(); lsvItem.Text = thisReader["ward_no"].ToString(); lsvItem.SubItems.Add(thisReader["total_bed"].ToString()); lsvItem.SubItems.Add(thisReader["bed_free"].ToString()); lsvItem.SubItems.Add(thisReader["empty_ward"].ToString()); listView1.Items.Add(lsvItem); } CN.thisConnection.Close(); }
public void make_comboBox2() { connection sv = new connection(); sv.thisConnection.Open(); string query = "SELECT * FROM ward_allocation order by ward_no "; OracleCommand cmddatabase = new OracleCommand(query, sv.thisConnection); OracleDataReader myReader = cmddatabase.ExecuteReader(); try { while (myReader.Read()) { ward_no.Items.Add(myReader.GetString(myReader.GetOrdinal("empty_ward"))); } } catch (Exception ex) { MessageBox.Show(ex.Message); } sv.thisConnection.Close(); }
private void button1_Click(object sender, EventArgs e) { connection sv = new connection(); sv.thisConnection.Open(); OracleCommand thisCommand = sv.thisConnection.CreateCommand(); thisCommand.CommandText = "update HOSPITAL_LOGIN set username ='******', password = '******' where username= '******'"; thisCommand.Connection = sv.thisConnection; thisCommand.CommandType = CommandType.Text; //For Insert Data Into Oracle// try { thisCommand.ExecuteNonQuery(); MessageBox.Show("Updated"); this.Hide(); } catch (Exception ex) { Console.WriteLine(ex.Message); } sv.thisConnection.Close(); Welcome ob = new Welcome(textBox1.Text); ob.Show(); this.Hide(); }
public void liv() { connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand = CN.thisConnection.CreateCommand(); thisCommand.CommandText = "SELECT * FROM prescription where p_id='" + textBox1.Text + "'"; OracleDataReader thisReader = thisCommand.ExecuteReader(); while (thisReader.Read()) { ListViewItem lsvItem = new ListViewItem(); lsvItem.Text = thisReader["med"].ToString(); lsvItem.SubItems.Add(thisReader["YES"].ToString()); lsvItem.SubItems.Add(thisReader["t_date"].ToString()); listView1.Items.Add(lsvItem); } CN.thisConnection.Close(); }
private void Welcome_Load(object sender, EventArgs e) { connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand = CN.thisConnection.CreateCommand(); thisCommand.CommandText = "SELECT * FROM HOSPITAL_LOGIN where username='******'"; OracleDataReader thisReader = thisCommand.ExecuteReader(); while (thisReader.Read()) { ListViewItem lsvItem = new ListViewItem(); lsvItem.Text = thisReader["username"].ToString(); // lsvItem.SubItems.Add(thisReader["password"].ToString()); lsvItem.SubItems.Add(thisReader["designation"].ToString()); listView1.Items.Add(lsvItem); } CN.thisConnection.Close(); }
private void searchBox_TextChanged(object sender, EventArgs e) { listView2.Items.Clear(); connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand = CN.thisConnection.CreateCommand(); thisCommand.CommandText = "SELECT * FROM doc_pres where p_id='" + searchBox.Text + "'"; OracleDataReader thisReader = thisCommand.ExecuteReader(); while (thisReader.Read()) { ListViewItem lsvItem = new ListViewItem(); lsvItem.Text = thisReader["p_id"].ToString(); lsvItem.SubItems.Add(thisReader["med"].ToString()); lsvItem.SubItems.Add(thisReader["morn_be_food"].ToString()); lsvItem.SubItems.Add(thisReader["morn_af_food"].ToString()); lsvItem.SubItems.Add(thisReader["afnn_be_food"].ToString()); lsvItem.SubItems.Add(thisReader["afnn_af_food"].ToString()); lsvItem.SubItems.Add(thisReader["night_be_food"].ToString()); lsvItem.SubItems.Add(thisReader["night_af_food"].ToString()); lsvItem.SubItems.Add(thisReader["if_need"].ToString()); lsvItem.SubItems.Add(thisReader["t_date"].ToString()); listView2.Items.Add(lsvItem); } CN.thisConnection.Close(); }
private void button3_Click(object sender, EventArgs e) { connection con = new connection(); con.thisConnection.Open(); OracleCommand thisCommand1 = con.thisConnection.CreateCommand(); thisCommand1.CommandText = "delete HOSPITAL_LOGIN where username= '******'"; thisCommand1.Connection = con.thisConnection; thisCommand1.CommandType = CommandType.Text; //For Insert Data Into Oracle// try { thisCommand1.ExecuteNonQuery(); MessageBox.Show("delete successfully"); this.Hide(); Welcome ob = new Welcome(); ob.Show(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private void appoinForm_Load(object sender, EventArgs e) { connection sv = new connection(); sv.thisConnection.Open(); string query = "SELECT * FROM DOCTOR_DATA "; OracleCommand cmddatabase = new OracleCommand(query, sv.thisConnection); OracleDataReader myReader = cmddatabase.ExecuteReader(); try { while (myReader.Read()) { comboBox2.Items.Add(myReader.GetString(myReader.GetOrdinal("department"))); appt = myReader["doc_visit_lim"].ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } int hello = Convert.ToInt32(appt); string start = "6:00 AM"; DateTime start1 = Convert.ToDateTime(start); string start2 = "7:00 AM"; DateTime start22 = Convert.ToDateTime(start2); if (start1 < tday && tday < start22) { string rev = "30"; OracleCommand thisCommand4 = sv.thisConnection.CreateCommand(); thisCommand4.CommandText = "update DOCTOR_DATA set doc_visit_lim ='" + rev + "'"; thisCommand4.Connection = sv.thisConnection; thisCommand4.CommandType = CommandType.Text; //For Insert Data Into Oracle// try { thisCommand4.ExecuteNonQuery(); this.Hide(); } catch (Exception dx) { Console.WriteLine(dx.Message); } } sv.thisConnection.Close(); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { string doc_n = comboBox1.Text.ToString(); connection sv = new connection(); sv.thisConnection.Open(); OracleCommand doc_pro = sv.thisConnection.CreateCommand(); textBox5.Text = ""; doc_pro.CommandText = "SELECT * FROM doctor_data where doc_name= '" + doc_n + "'"; OracleDataReader thisReader4 = doc_pro.ExecuteReader(); while (thisReader4.Read()) { try { textBox5.Text = thisReader4["appointment_time"].ToString(); OracleCommand thisCommand = sv.thisConnection.CreateCommand(); textBox3.Text = ""; thisCommand.CommandText = "SELECT * FROM doctor_data where department= '" + comboBox2.Text + "' and doc_name='" + comboBox1.Text + "'"; OracleDataReader thisReader = thisCommand.ExecuteReader(); while (thisReader.Read()) { try { int limit = Convert.ToInt32(thisReader["doc_visit_lim"].ToString()); if (limit >= 1) { String dy = tday.Day.ToString(); String mn = tday.Month.ToString(); String yy = tday.Year.ToString(); textBox3.Text = dy + mn + yy + thisReader["doc_id"].ToString() + (31 - limit); } seri = limit; doc_ID = thisReader["doc_id"].ToString(); } catch { MessageBox.Show("Failure"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } } sv.thisConnection.Close(); }
private void button1_Click(object sender, EventArgs e) { connection sv = new connection(); sv.thisConnection.Open(); OracleDataAdapter thisAdapter = new OracleDataAdapter("SELECT * FROM HOSPITAL_LOGIN", sv.thisConnection); OracleCommandBuilder thisBuilder = new OracleCommandBuilder(thisAdapter); DataSet thisDataSet = new DataSet(); thisAdapter.Fill(thisDataSet, "HOSPITAL_LOGIN"); DataRow thisRow = thisDataSet.Tables["HOSPITAL_LOGIN"].NewRow(); OracleCommand thisCommand = sv.thisConnection.CreateCommand(); thisCommand.CommandText = "SELECT * FROM HOSPITAL_LOGIN WHERE username='******'"; OracleDataReader thisReader = thisCommand.ExecuteReader(); try { if (thisReader.Read()) { MessageBox.Show("Username already exists!!!"); } else { thisRow["username"] = textBox1.Text; thisRow["password"] = textBox2.Text; thisRow["designation"] = thisReader["designation"].ToString(); thisDataSet.Tables["HOSPITAL_LOGIN"].Rows.Add(thisRow); thisAdapter.Update(thisDataSet, "HOSPITAL_LOGIN"); MessageBox.Show("Submitted"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } sv.thisConnection.Close(); Welcome ob = new Welcome(); ob.Show(); this.Hide(); }
// Bitmap bitmap; private void button2_Click(object sender, EventArgs e) { connection sv = new connection(); sv.thisConnection.Open(); string yes = "Yes"; OracleCommand thisCommand = sv.thisConnection.CreateCommand(); thisCommand.CommandText = "update doctor_appointment set visit_status = '" + yes + "' where token_id= '" + textBox1.Text + "'"; thisCommand.Connection = sv.thisConnection; thisCommand.CommandType = CommandType.Text; //For Insert Data Into Oracle// if (String.IsNullOrEmpty(textBox3.Text)) { MessageBox.Show("Please write something to advice!!!!"); } else if (!String.IsNullOrEmpty(textBox3.Text)) { try { thisCommand.ExecuteNonQuery(); PrintDocument doc = new PrintDocument(); doc.DefaultPageSettings.Landscape = true; doc.PrintPage += this.printDocument1_PrintPage; PrintDialog dlgSettings = new PrintDialog(); dlgSettings.Document = doc; if (dlgSettings.ShowDialog() == DialogResult.OK) { doc.Print(); } // MessageBox.Show("submitted"); this.Hide(); } catch (Exception ex) { Console.WriteLine(ex.Message); } sv.thisConnection.Close(); DocAppointment ob = new DocAppointment(); ob.Show(); } }
private void Edit_Click(object sender, EventArgs e) { connection sv = new connection(); sv.thisConnection.Open(); OracleCommand thisCommand1 = sv.thisConnection.CreateCommand(); thisCommand1.CommandText = "update HOSPITAL_LOGIN set username= '******', " + "designation='" + position.Text + "' where id= '" + em_id.Text + "'"; thisCommand1.Connection = sv.thisConnection; thisCommand1.CommandType = CommandType.Text; OracleCommand thisCommand2 = sv.thisConnection.CreateCommand(); thisCommand2.CommandText = "update salary_account set name= '" + em_name.Text + "', salary='" + salaryBox.Text + "', " + "position='" + position.Text + "',accountid='" + acId.Text + "', duty_time= '" + DutyTime.Text + "' where id= '" + em_id.Text + "'"; thisCommand2.Connection = sv.thisConnection; thisCommand2.CommandType = CommandType.Text; OracleCommand thisCommand3 = sv.thisConnection.CreateCommand(); thisCommand3.CommandText = "update doctor_data set doc_name= '" + em_name.Text + "', ward_no= '" + ward_no.Text + "', department = '" + depart.Text + "', " + "designation='" + Designation.Text + "', duty_time = '" + DutyTime.Text + "', appointment_time = '" + appt.Text + "' where doc_id= '" + em_id.Text + "'"; thisCommand3.Connection = sv.thisConnection; thisCommand3.CommandType = CommandType.Text; try { thisCommand1.ExecuteNonQuery(); thisCommand2.ExecuteNonQuery(); thisCommand3.ExecuteNonQuery(); MessageBox.Show("Updated"); this.Hide(); } catch (Exception ex) { Console.WriteLine(ex.Message); } sv.thisConnection.Close(); this.Hide(); editData ob = new editData(); ob.Show(); }
private void button1_Click_1(object sender, EventArgs e) { connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand = new OracleCommand(); thisCommand.Connection = CN.thisConnection; thisCommand.CommandText = "SELECT * FROM HOSPITAL_LOGIN WHERE username='******' AND password='******'"; thisReader = thisCommand.ExecuteReader(); if (thisReader.Read()) { AccountPage oform = new AccountPage(); oform.Show(); this.Hide(); } }
public void make_p_id() { connection sv = new connection(); sv.thisConnection.Open(); string query = "SELECT * FROM ward_allocation order by empty_ward desc"; OracleCommand cmddatabase = new OracleCommand(query, sv.thisConnection); OracleDataReader myReader = cmddatabase.ExecuteReader(); string Yes = "Yes"; string query2 = "SELECT * FROM patient_data where if_release_paid='" + Yes + "'"; OracleCommand cmddatabase2 = new OracleCommand(query2, sv.thisConnection); OracleDataReader myReader2 = cmddatabase2.ExecuteReader(); try { while (myReader.Read() && myReader2.Read()) { if (myReader["bed_free"].ToString() != "0") { if (myReader2["if_release_paid"].ToString() == "Yes") { p_id.Text = myReader2["p_id"].ToString(); } } } while (myReader.Read()) { if (myReader["bed_free"].ToString() != "0") { p_id.Text = myReader["empty_ward"].ToString() + myReader["bed_free"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } sv.thisConnection.Close(); }
private void AdminPage_Load(object sender, EventArgs e) { if (firstDay == dt) { textBox1.Text = "Today is Salary"; textBox1.ReadOnly = true; } else { textBox1.Text = dt6.ToString(); textBox1.ReadOnly = true; } connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand = CN.thisConnection.CreateCommand(); tot_income.Text = ""; thisCommand.CommandText = "SELECT SUM(total_cost) as admit_cost,SUM(rel_amount) as rel_cost FROM patient_data"; OracleDataReader thisReader = thisCommand.ExecuteReader(); while (thisReader.Read()) { string ad_cost = thisReader["admit_cost"].ToString(); int a_cost = Convert.ToInt32(ad_cost); string rel_cost = thisReader["rel_cost"].ToString(); int r_cost = Convert.ToInt32(rel_cost); int TotalCost = a_cost + r_cost; tot_income.Text = TotalCost.ToString(); tot_income.ReadOnly = true; textBox2.Text = ad_cost; textBox3.Text = rel_cost; try { } catch { MessageBox.Show("Failure"); } } }
private void button2_Click(object sender, EventArgs e) { connection con = new connection(); con.thisConnection.Open(); OracleCommand thisCommand1 = con.thisConnection.CreateCommand(); thisCommand1.CommandText = "delete hospital_login where id= '" + em_id.Text + "'"; thisCommand1.Connection = con.thisConnection; thisCommand1.CommandType = CommandType.Text; OracleCommand thisCommand2 = con.thisConnection.CreateCommand(); thisCommand2.CommandText = "delete salary_account where id= '" + em_id.Text + "'"; thisCommand2.Connection = con.thisConnection; thisCommand2.CommandType = CommandType.Text; OracleCommand thisCommand3 = con.thisConnection.CreateCommand(); thisCommand3.CommandText = "delete doctor_data where doc_id= '" + em_id.Text + "'"; thisCommand3.Connection = con.thisConnection; thisCommand3.CommandType = CommandType.Text; //For Insert Data Into Oracle// try { thisCommand1.ExecuteNonQuery(); thisCommand2.ExecuteNonQuery(); thisCommand3.ExecuteNonQuery(); MessageBox.Show("delete successfully"); this.Hide(); deleteData ob = new deleteData(); ob.Show(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (mtime.Text != " No Medicine Time Now") { connection sv = new connection(); sv.thisConnection.Open(); OracleDataAdapter thisAdapter = new OracleDataAdapter("SELECT * FROM prescription", sv.thisConnection); OracleCommandBuilder thisBuilder = new OracleCommandBuilder(thisAdapter); DataSet thisDataSet = new DataSet(); thisAdapter.Fill(thisDataSet, "prescription"); DataRow thisRow = thisDataSet.Tables["prescription"].NewRow(); try { thisRow["p_id"] = textBox1.Text; thisRow["med"] = comboBox1.Text; thisRow["YES"] = mtime.Text; thisRow["t_date"] = today; thisDataSet.Tables["prescription"].Rows.Add(thisRow); thisAdapter.Update(thisDataSet, "prescription"); MessageBox.Show("Checked"); } catch (Exception ex) { MessageBox.Show(ex.Message); } sv.thisConnection.Close(); this.Hide(); nurse_page ob = new nurse_page(); ob.Show(); } else { MessageBox.Show("No medicine can be applied now"); } }
private void button2_Click(object sender, EventArgs e) { connection sv = new connection(); sv.thisConnection.Open(); OracleDataAdapter thisAdapter = new OracleDataAdapter("SELECT * FROM doc_pres", sv.thisConnection); OracleCommandBuilder thisBuilder = new OracleCommandBuilder(thisAdapter); DataSet thisDataSet = new DataSet(); thisAdapter.Fill(thisDataSet, "doc_pres"); DataRow thisRow = thisDataSet.Tables["doc_pres"].NewRow(); try { thisRow["p_id"] = comboBox1.Text; thisRow["med"] = textBox1.Text; thisRow["MORN_BE_FOOD"] = checkBox1.Text; thisRow["MORN_AF_FOOD"] = checkBox2.Text; thisRow["AFNN_BE_FOOD"] = checkBox3.Text; thisRow["AFNN_AF_FOOD"] = checkBox4.Text; thisRow["NIGHT_BE_FOOD"] = checkBox5.Text; thisRow["NIGHT_AF_FOOD"] = checkBox6.Text; thisRow["IF_NEED"] = checkBox7.Text; thisRow["T_DATE"] = td; thisDataSet.Tables["doc_pres"].Rows.Add(thisRow); thisAdapter.Update(thisDataSet, "doc_pres"); MessageBox.Show("Submitted"); } catch (Exception ex) { MessageBox.Show(ex.Message); } sv.thisConnection.Close(); }
private void PatientPage_Load(object sender, EventArgs e) { connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand = CN.thisConnection.CreateCommand(); OracleCommand thisCommand2 = CN.thisConnection.CreateCommand(); thisCommand.CommandText = "SELECT * FROM patient_data"; thisCommand2.CommandText = "SELECT * FROM ward_allocation"; OracleDataReader thisReader = thisCommand.ExecuteReader(); OracleDataReader thisReader2 = thisCommand2.ExecuteReader(); while (thisReader.Read()) { ListViewItem lsvItem = new ListViewItem(); lsvItem.Text = thisReader["p_id"].ToString(); lsvItem.SubItems.Add(thisReader["p_name"].ToString()); lsvItem.SubItems.Add(thisReader["admit_date"].ToString()); lsvItem.SubItems.Add(thisReader["release_date"].ToString()); lsvItem.SubItems.Add(thisReader["ward_no"].ToString()); // lsvItem.SubItems.Add(thisReader2["empty_ward"].ToString()); listView1.Items.Add(lsvItem); } while (thisReader2.Read()) { ListViewItem lsvItem2 = new ListViewItem(); lsvItem2.Text = thisReader2["EMPTY_WARD"].ToString(); listView2.Items.Add(lsvItem2); } CN.thisConnection.Close(); }
private void checkBox1_CheckedChanged(object sender, EventArgs e) { connection sv = new connection(); sv.thisConnection.Open(); OracleDataAdapter thisAdapter = new OracleDataAdapter("SELECT * FROM attendance", sv.thisConnection); OracleCommandBuilder thisBuilder = new OracleCommandBuilder(thisAdapter); DataSet thisDataSet = new DataSet(); thisAdapter.Fill(thisDataSet, "attendance"); DataRow thisRow = thisDataSet.Tables["attendance"].NewRow(); try { thisRow["id"] = id_doc; thisRow["name"] = name_doc; thisRow["position"] = "doctor"; thisRow["attendance"] = "Y"; thisRow["date_today"] = da; thisDataSet.Tables["attendance"].Rows.Add(thisRow); thisAdapter.Update(thisDataSet, "attendance"); MessageBox.Show("Checked"); } catch (Exception ex) { MessageBox.Show(ex.Message); } sv.thisConnection.Close(); this.Hide(); DoctorPage ob = new DoctorPage(); ob.Show(); }
private void button1_Click(object sender, EventArgs e) { connection sv = new connection(); sv.thisConnection.Open(); OracleDataAdapter thisAdapter = new OracleDataAdapter("SELECT * FROM ward_allocation", sv.thisConnection); OracleCommandBuilder thisBuilder = new OracleCommandBuilder(thisAdapter); DataSet thisDataSet = new DataSet(); thisAdapter.Fill(thisDataSet, "ward_allocation"); DataRow thisRow = thisDataSet.Tables["ward_allocation"].NewRow(); try { thisRow["ward_no"] = textBox1.Text; thisRow["total_bed"] = "0"; thisRow["bed_free"] = "0"; thisRow["empty_ward"] = "0"; thisDataSet.Tables["ward_allocation"].Rows.Add(thisRow); thisAdapter.Update(thisDataSet, "ward_allocation"); MessageBox.Show("Submitted"); } catch (Exception ex) { MessageBox.Show(ex.Message); } sv.thisConnection.Close(); this.Hide(); ward ss = new ward(); ss.Show(); }
private void button1_Click(object sender, EventArgs e) { connection sv = new connection(); sv.thisConnection.Open(); OracleCommand thisCommand = sv.thisConnection.CreateCommand(); string no = "No"; thisCommand.CommandText = "update doctor_appointment set weight_kg = '" + wet.Text + "',pulse_min = '" + pulse.Text + "'," + "bp = '" + bpp.Text + "',additional_info = '" + add.Text + "', visit_status = '" + no + "' where token_id= '" + token.Text + "'"; thisCommand.Connection = sv.thisConnection; thisCommand.CommandType = CommandType.Text; //For Insert Data Into Oracle// try { thisCommand.ExecuteNonQuery(); MessageBox.Show("submitted"); this.Hide(); } catch (Exception ex) { Console.WriteLine(ex.Message); } sv.thisConnection.Close(); this.Hide(); compounder ob = new compounder(); ob.Show(); }
void loading() { connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand1 = CN.thisConnection.CreateCommand(); OracleCommand thisCommand = CN.thisConnection.CreateCommand(); thisCommand.CommandText = "SELECT * FROM doc_pres"; OracleDataReader thisReader = thisCommand.ExecuteReader(); while (thisReader.Read()) { ListViewItem lsvItem = new ListViewItem(); lsvItem.Text = thisReader["p_id"].ToString(); lsvItem.SubItems.Add(thisReader["med"].ToString()); lsvItem.SubItems.Add(thisReader["morn_be_food"].ToString()); lsvItem.SubItems.Add(thisReader["morn_af_food"].ToString()); lsvItem.SubItems.Add(thisReader["afnn_be_food"].ToString()); lsvItem.SubItems.Add(thisReader["afnn_af_food"].ToString()); lsvItem.SubItems.Add(thisReader["night_be_food"].ToString()); lsvItem.SubItems.Add(thisReader["night_af_food"].ToString()); lsvItem.SubItems.Add(thisReader["if_need"].ToString()); lsvItem.SubItems.Add(thisReader["t_date"].ToString()); listView2.Items.Add(lsvItem); } CN.thisConnection.Close(); }
private void textBox1_TextChanged_1(object sender, EventArgs e) { connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand = CN.thisConnection.CreateCommand(); pn.Text = ""; pa.Text = ""; textBox6.Text = ""; textBox7.Text = ""; textBox8.Text = ""; textBox10.Text = ""; thisCommand.CommandText = "SELECT * FROM doctor_appointment where token_id= '" + textBox1.Text + "'"; OracleDataReader thisReader = thisCommand.ExecuteReader(); while (thisReader.Read()) { try { pn.Text = thisReader["patient_name"].ToString(); pa.Text = thisReader["p_age"].ToString(); textBox6.Text = thisReader["weight_kg"].ToString(); textBox7.Text = thisReader["pulse_min"].ToString(); textBox8.Text = thisReader["bp"].ToString(); textBox10.Text = thisReader["additional_info"].ToString(); } catch { MessageBox.Show("Failure"); } ins(); } }
private void button1_Click(object sender, EventArgs e) { string yes = "Yes"; connection sv = new connection(); sv.thisConnection.Open(); if (rel_date == "0") { OracleCommand thisCommand4 = sv.thisConnection.CreateCommand(); thisCommand4.CommandText = "update patient_data set release_date ='" + tday + "',if_release_paid ='" + yes + "'," + "rel_amount='" + textBox1.Text + "' where p_id= '" + p_id.Text + "'"; thisCommand4.Connection = sv.thisConnection; thisCommand4.CommandType = CommandType.Text; //For Insert Data Into Oracle// try { thisCommand4.ExecuteNonQuery(); } catch (Exception ex) { Console.WriteLine(ex.Message); } OracleCommand thisCommand2 = sv.thisConnection.CreateCommand(); // textBox1.Text = ""; thisCommand2.CommandText = "SELECT * FROM ward_allocation where ward_no= '" + wardNo + "'"; OracleDataReader thisReader2 = thisCommand2.ExecuteReader(); while (thisReader2.Read()) { // string ad_cost = thisReader["admit_cost"].ToString(); string tb = thisReader2["total_bed"].ToString(); int totalbed = Convert.ToInt32(tb); bf = thisReader2["bed_free"].ToString(); int bedFre = Convert.ToInt32(bf); if (bedFre <= totalbed) { int bed = (bedFre + 1); bedFree = bed.ToString(); } else if (bedFre > totalbed) { bedFree = tb; } try { // string filePath = thisReader["picture"].ToString(); // this.pb_profilepics.Image = Image.FromFile(filePath); } catch { MessageBox.Show("Failure"); } } OracleCommand thisCommand3 = sv.thisConnection.CreateCommand(); thisCommand3.CommandText = "update ward_allocation set bed_free ='" + bedFree + "' where ward_no= '" + wardNo + "'"; thisCommand3.Connection = sv.thisConnection; thisCommand3.CommandType = CommandType.Text; //For Insert Data Into Oracle// try { thisCommand3.ExecuteNonQuery(); MessageBox.Show("released"); } catch (Exception ex) { Console.WriteLine(ex.Message); } if (bf != "0") { OracleCommand thisCommand5 = sv.thisConnection.CreateCommand(); thisCommand5.CommandText = "update ward_allocation set empty_ward = ward_no where ward_no= '" + wardNo + "'"; OracleDataReader thisReader4 = thisCommand5.ExecuteReader(); } else if (bf == "0") { OracleCommand thisCommand6 = sv.thisConnection.CreateCommand(); thisCommand6.CommandText = "update ward_allocation set empty_ward = 0 where ward_no= '" + wardNo + "'"; OracleDataReader thisReader7 = thisCommand6.ExecuteReader(); } } else { MessageBox.Show("Have been released"); } sv.thisConnection.Close(); PatientPage ob = new PatientPage(); ob.Show(); this.Hide(); }
private void p_id_TextChanged(object sender, EventArgs e) { connection CN = new connection(); CN.thisConnection.Open(); OracleCommand thisCommand2 = CN.thisConnection.CreateCommand(); textBox1.Text = ""; thisCommand2.CommandText = "SELECT p_id FROM patient_data"; OracleDataReader thisReader2 = thisCommand2.ExecuteReader(); if (p_id.Text == "" && thisReader2.Read().ToString() != p_id.Text) { td.Text = ""; bc.Text = ""; fc.Text = ""; mc.Text = ""; sc.Text = ""; textBox1.Text = ""; } else { OracleCommand thisCommand = CN.thisConnection.CreateCommand(); textBox1.Text = ""; thisCommand.CommandText = "SELECT * FROM patient_data where p_id= '" + p_id.Text + "'"; OracleDataReader thisReader = thisCommand.ExecuteReader(); while (thisReader.Read()) { try { // string filePath = thisReader["picture"].ToString(); // this.pb_profilepics.Image = Image.FromFile(filePath); // string ad_cost = thisReader["admit_cost"].ToString(); int per_day_bed_cost = 5000; int per_day_food_cost = 500; int per_day_med_cost = 3000; int per_day_ser_cost = 1000; string fromDate = thisReader["admit_date"].ToString(); wardNo = thisReader["ward_no"].ToString(); DateTime enteredDate = DateTime.Parse(fromDate); DateTime today = DateTime.Today; tday = today.ToString(); int totalDay = (today.Date - enteredDate.Date).Days; td.Text = totalDay.ToString(); bc.Text = per_day_bed_cost.ToString(); fc.Text = per_day_food_cost.ToString(); mc.Text = per_day_med_cost.ToString(); sc.Text = per_day_ser_cost.ToString(); int totalCost = (per_day_bed_cost * totalDay) + (per_day_food_cost * totalDay) + (per_day_med_cost * totalDay) + (per_day_ser_cost * totalDay); rel_date = thisReader["release_date"].ToString(); textBox1.Text = totalCost.ToString(); } catch { MessageBox.Show("Failure"); } } } }